• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tari-project / tari-crypto / 6335787182
81%

Build:
DEFAULT BRANCH: main
Ran 28 Sep 2023 07:41AM UTC
Jobs 1
Files 22
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Sep 2023 07:21AM UTC coverage: 89.943% (+0.07%) from 89.869%
6335787182

push

github

web-flow
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

New Missed Lines in Diff

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

Uncovered Existing Lines

Lines Coverage ∆ File
13
70.44
-6.27% src/signatures/schnorr.rs
Jobs
ID Job ID Ran Files Coverage
1 6335787182.1 28 Sep 2023 07:41AM UTC 22
89.94
GitHub Action Run
Source Files on build 6335787182
  • Tree
  • List 22
  • Changed 14
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • f9b6cb8f on github
  • Prev Build on main (#6143412854)
  • Next Build on main (#6639817569)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc