Ran
|
Jobs
1
|
Files
22
|
Run time
1s
|
Badge
Embed ▾
README BADGES
|
push
github
feat!: differentiate scalar parsing from byte arrays (#194) Currently, creating a scalar `RistrettoSecretKey` [from a byte array](https://github.com/tari-project/tari-crypto/blob/053119f21/src/ristretto/ristretto_keys.rs#L90-L100) performs modular reduction on 32 bytes. For cases where the input is intended to be canonical, this is suboptimal. For cases where the input is produced from a hashing operation, wide reduction should be used to mitigate bias. This work renames `SecretKey::from_bytes` to `SecretKey::from_canonical_bytes` to support an underlying `ByteArray` trait update. In the case of `RistrettoSecretKey`, it uses the curve library's canonical parser and returns an error if the provided byte slice is not a canonical scalar encoding. It also adds a new `SecretKey::from_uniform_bytes` function that uses wide reduction. For constructions like signatures and KDFs that use hashing operations to produce scalar values, this function is used and the underlying hashers are updated to produce 64-byte output in the case of `RistrettoSecretKey`. It updates the Schnorr signature API to support raw signing and verification using challenge byte slices that are either canonical encodings or uniform. It renames several existing functions for clarity. It corrects a few typos that were discovered along the way. Closes #189. BREAKING CHANGE: This changes the way that scalars are produced from byte arrays, modifies the `SecretKey` trait and corresponding `RistrettoSecretKey` implementation, and updates the Schnorr signature API.
122 of 122 new or added lines in 11 files covered. (100.0%)
3470 of 3858 relevant lines covered (89.94%)
73.09 hits per line
Lines | Coverage | ∆ | File |
---|---|---|---|
1 |
88.38 |
-0.04% | src/hashing.rs |
1 |
95.13 |
-0.02% | src/ristretto/ristretto_keys.rs |
3 |
68.18 |
0.0% | src/signatures/commitment_signature.rs |
7 |
70.44 |
-6.27% | src/signatures/schnorr.rs |
Lines | Coverage | ∆ | File |
---|---|---|---|
13 |
70.44 |
-6.27% | src/signatures/schnorr.rs |
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 6335787182.1 | 22 |
89.94 |
GitHub Action Run |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|