Skip to content

Commit

Permalink
ecdsa: fix 32-bit builds for the dev feature (#177)
Browse files Browse the repository at this point in the history
They weren't tested before. They are now!
  • Loading branch information
tarcieri authored Sep 28, 2020
1 parent cc78368 commit a404deb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ecdsa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ jobs:
override: true
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features arithmetic
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features dev
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features digest
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features hazmat
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features sign
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features verify
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features zeroize
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features arithmetic,digest,hazmat,sign,verify,zeroize
- run: cargo build --no-default-features --release --target ${{ matrix.target }} --features arithmetic,dev,digest,hazmat,sign,verify,zeroize

test:
runs-on: ubuntu-latest
Expand All @@ -56,6 +57,7 @@ jobs:
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- run: cargo check --all-features
- run: cargo test --no-default-features
- run: cargo test
Expand Down
23 changes: 21 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ecdsa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ hmac = { version = "0.9", optional = true, default-features = false }
signature = { version = ">= 1.2.2, < 1.3.0", default-features = false, features = ["rand-preview"] }

[dev-dependencies]
hex-literal = "0.3"
hex-literal = "0.2"
sha2 = { version = "0.9", default-features = false }

[features]
Expand Down
5 changes: 5 additions & 0 deletions ecdsa/src/dev/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ impl Field for Scalar {

impl PrimeField for Scalar {
type Repr = FieldBytes;

#[cfg(target_pointer_width = "32")]
type ReprBits = [u32; 8];

#[cfg(target_pointer_width = "64")]
type ReprBits = [u64; 4];

const NUM_BITS: u32 = 256;
Expand Down

0 comments on commit a404deb

Please sign in to comment.