Skip to content

Commit

Permalink
Merge pull request #90 from andrewwhitehead/h2c-api-upd
Browse files Browse the repository at this point in the history
Update to hash-to-curve draft 16, with some API adjustments
  • Loading branch information
str4d authored Jul 21, 2024
2 parents e457e51 + 09466e0 commit 2874b5a
Show file tree
Hide file tree
Showing 12 changed files with 1,297 additions and 1,237 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rustdoc-args = [ "--html-in-header", "katex-header.html" ]
[dev-dependencies]
csv = ">= 1.0, < 1.2" # csv 1.2 has MSRV 1.60
criterion = "0.3"
hex = "0.4"
hex-literal = "0.3"
rand_xorshift = "0.3"
sha2 = "0.9"
sha3 = "0.9"
Expand Down Expand Up @@ -69,7 +69,7 @@ bits = ["ff/bits"]
groups = ["group"]
pairings = ["groups", "pairing"]
alloc = ["group/alloc"]
experimental = ["digest"]
experimental = ["digest", "groups"]
nightly = ["subtle/nightly"]

[[test]]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If you want to propose "substantial" changes to this crate, please
* `alloc` (on by default): Enables APIs that require an allocator; these include pairing optimizations.
* `nightly`: Enables `subtle/nightly` which tries to prevent compiler optimizations that could jeopardize constant time operations. Requires the nightly Rust compiler.
* `experimental`: Enables experimental features. These features have no backwards-compatibility guarantees and may change at any time; users that depend on specific behaviour should pin an exact version of this crate. The current list of experimental features:
* Hashing to curves ([Internet Draft v12](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-12))
* Hashing to curves ([Internet Draft v16](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16))

## [Documentation](https://docs.rs/bls12_381)

Expand Down
8 changes: 4 additions & 4 deletions benches/hash_to_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn criterion_benchmark(c: &mut Criterion) {
move |b| {
b.iter(|| {
<G1Projective as HashToCurve<ExpandMsgXmd<sha2::Sha256>>>::encode_to_curve(
black_box(message),
[black_box(message)],
black_box(dst),
)
})
Expand All @@ -29,7 +29,7 @@ fn criterion_benchmark(c: &mut Criterion) {
c.bench_function(&format!("{} hash_to_curve SSWU SHA-256", name), move |b| {
b.iter(|| {
<G1Projective as HashToCurve<ExpandMsgXmd<sha2::Sha256>>>::hash_to_curve(
black_box(message),
[black_box(message)],
black_box(dst),
)
})
Expand All @@ -47,7 +47,7 @@ fn criterion_benchmark(c: &mut Criterion) {
move |b| {
b.iter(|| {
<G2Projective as HashToCurve<ExpandMsgXmd<sha2::Sha256>>>::encode_to_curve(
black_box(message),
[black_box(message)],
black_box(dst),
)
})
Expand All @@ -56,7 +56,7 @@ fn criterion_benchmark(c: &mut Criterion) {
c.bench_function(&format!("{} hash_to_curve SSWU SHA-256", name), move |b| {
b.iter(|| {
<G2Projective as HashToCurve<ExpandMsgXmd<sha2::Sha256>>>::hash_to_curve(
black_box(message),
[black_box(message)],
black_box(dst),
)
})
Expand Down
Loading

0 comments on commit 2874b5a

Please sign in to comment.