Comments (11)
PhantomData
has only one value, called PhantomData
. Use that.
from rust-bitcoin.
FYI I had a PR to do this but it got stale and I'm actually currently working on a replacement since the hash stuff got complicated.
from rust-bitcoin.
from_byte_array
and all_zeros
could be made const and we could do a point release (assuming there are no other breaking changes in the hashes pipeline yet, which I believe is true).
Actually hashing in constant time is far from trivial, though I haven't tried in a little while.
from rust-bitcoin.
Actually hashing in constant time is far from trivial, though I haven't tried in a little while.
from rust-bitcoin.
Oh, lol :). So @stevenroose there is a const constructor.
But agreed that all_zeros
and from_byte_array
should also be const.
from rust-bitcoin.
Definitely!
from rust-bitcoin.
Seems that Rust does not allow functions within traits to be marked as const
.
ref: https://users.rust-lang.org/t/whats-the-reason-that-fn-in-a-trait-cannot-marked-as-a-const/68636
from rust-bitcoin.
Ah, yeah, that is probably why these aren't const already. We should move those methods out of the trait into inherents.
from rust-bitcoin.
We should move those methods out of the trait into inherents.
Yes!
from rust-bitcoin.
rust-bitcoin/hashes/src/sha256t.rs
Line 23 in 9df5963
In all_zeros
and from_byte_array
methods in Hash<T>
impl -> what should be the value of PhantomData
part in it?
from rust-bitcoin.
Did anyone also getting same errors while making commits ?
from rust-bitcoin.
Related Issues (20)
- version error PSBT versions greater than 0 are not supported HOT 1
- Principled fix for #2521
- CI: MemorySanitizer is erroring (ASAN job) HOT 12
- units: Audit all types for correct usage of `Ord` vs `ArbitraryOrd` HOT 4
- Inherent functions `to_bytes` / `from_bytes` HOT 6
- Shoosh semver informational part build warning
- CI fails are hard to view HOT 9
- crate labels go stale
- Changes that require updating the lock files do not fail CI HOT 3
- Add `just` command to install githooks HOT 1
- Our current merge policy/script causes excessive delay and work HOT 2
- deserializing network message can request arbitrary sized allocations HOT 6
- Can we sort `rustfmt` out once and for all HOT 5
- Add type data to TxOut HOT 15
- Should `LockTime` types live in `units` HOT 8
- Consider not deriving `serde` impls from `units` types HOT 12
- Is introducing `LockTimeUnit` enum promote redundancy? HOT 3
- Should `Script::witness_version` check if the script `is_witness_program` before it returns the version? HOT 2
- Make sure we mention than 'm/' is not handled in bip32 derivation paths HOT 1
- Use `Message::from` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-bitcoin.