This release is massive. The biggest visable changes are to the Hash
trait, which has mostly been replaced
by inherent functions. You should not need to import it at all anymore for normal usage. Check out how we are
using hashes
in rust-bitcoin
to see an example. Enjoy!
-
Remove the
util
andserde_macros
modules and roll all code into new publicmacros
module #3299 -
Remove
SliceIndex
implementation from hash types #3296 -
Rename
Midstate::into_parts
toMidstate::to_parts
since it derivesCopy
#3429 -
Remove
schemars
support #3395 -
Deprecate
from_slice
methods in favor of arrays #3301 -
Rename
length
field tobytes_hashed
#3298 -
Enforce that
Hash::Bytes
is an array #3257 -
Siphash24
cleanup #3222 -
Reduce API surface of tagged wrapped hash types #3184
-
Rename
const_hash
functions tohash_unoptimized
#3129 -
Remove
io
feature (usebitcoin-io
dependency directly) #3128 -
Rename
Siphash::as_u64
toSiphash::to_u64
#3119 -
Push up the
Default
bound onHashEngine
in order to better support keyed hash functions #3113 -
Add a new
hash_reader
function #3077 -
Add
length
field tosha256::Midstate
#3010 -
Remove midstate from the
GeneralHash
andHashEngine
traits #3009 -
Add additional
HashEngine
types #2988 -
Remove
to
/from
/as_raw_hash
functions #2981 -
Split
Hash
trait intoGeneralHash
andHash
#2910 -
Remove
all_zeros
and constify constructors #2877 -
Add inherent functions to hashes (reduces need to import
Hash
) #2852 -
Add HKDF support #2644
-
Bump MSRV to Rust version 1.63.0 #3100
-
Change the default display direction of for tagged hashes to forwards #2707
Note please this usage if you need to display backward:
sha256t_hash_newtype! {
/// Test detailed explanation.
struct NewTypeTag = hash_str("tag");
/// A test hash.
#[hash_newtype(backward)]
struct NewTypeHash(_);
}
- Bump MSRV to Rust version 1.56.1 #2188
- Add support for SHA384 #2538
- Make from_hex inherent for byte-like types #2491
- Add
Hash::from_bytes_iter
to construct hashes from iterators #2272 - Make some constructors
const
#2446
The main improvement in this version is removal of the hex
module in favour of the new
hex-conservative
crate (which we wrote). We also
bumped the Minimum Supported Rust Version across the rust-bitcoin
ecosystem to v1.48
- Bump MSRV to 1.48.0 #1729.
- Depend on new
hex-conservative
crate and removehex
module #1883. - Make
sha256t_hash_newtype!
evocative of the output #1773. - Implement computing SHA256 in const context #1769.
- Add
from_bytes_ref
andfrom_bytes_mut
to all hash types #1761. - Rename
crate::Error
tocrate::FromSliceError
#1873. - Add simd sha256 intrinsics for x86 machines #1962.
- Introduce the "small-hash" feature for
bitcoin_hashes
#1990.
0.12 is a significant release. We pulled the repository into the rust-bitcoin repo to improve our integration testing and to get more eyes on this crate. We began the process of replacing the hex functionality in this crate with a more performant, dedicated crate, and otherwise cleaning up the API as we look forward to 1.0.
- Remove
FromHex
implementation from all hashes and implementFromStr
instead. - Move crate from original repo to the
rust-bitcoin
repository. Commit history was lost during move, for commit history see the original repository. Tip of bitcoin_hashes:master at time of import: 54c16249e06cc6b7870c7fc07d90f489d82647c7 - Remove
Deref
impls for all hashes - Add
AsRef
impls for all hashes from fixed-size arrays - Add the
sha512_256
hash - Remove the
ToHex
trait in favor ofDisplayHex
andfmt::Display
- Remove the now-unused
HexWriter
object - nostd:
alloc
feature no longer enablescore2
- Rewrite
hash_newtype
macro with new syntax - Rename
Hash::Inner
toHash::Bytes
, 'Hash::*_inner` and several related conversion methods
The major change in this version is the increase of the Minimum Supported Rust Version (MSRV) from 1.29 to 1.41.1. This is a big change because it introduces Rust Edition 2018 to the codebase along with all the benefits that brings. We also did a bunch of optimisations to speed up encoding and decoding hex strings.
- Add
all_zeros
toHash
trait - Implement
Write
onHmacEngine
- Introduce
HexWriter
, makes serialising hex faster - Implement
Read
onHexIterator
, makes deserialising hex faster
- Use
rotate_left
instead of custom macro - Enable clippy on CI
- Various docs fixes
- Improve feature test coverage
- Add a disabled
rustfmt.toml
to improve interaction with auto-formatting in editors
- Increase
core2
to released version of 0.3.0
- Introduce
alloc
feature andcore2
dependency for nostd support (this feature has MSRV of 1.36 rather than 1.29)
- Re-export
core
as_export::_core
. This resolves an issue when calling several exported macros with thestd
feature.
- Add
#[repr(transparent)]
to all newtype wrappers - Add missing
#derive
s - Replace
fuzztarget
feature with use ofcfg(fuzzing)
- Use
core
rather thanstd
and fixno_std
compilation
Note that we have stopped re-exporting the core
crate when compiling without std
. This is technically a breaking change but it is hard to imagine what user might be affected.
- Add
Hmac::from_inner_engines
- More serde macro fixes
- Fix rustc 1.29.0 downstream issues with serde macros
- Fix visibility issue with serde macros
- Add
FromStr
impl tosha256t::Hash
- Fix
Hash::engine()
implementation for hash newtypes - Add
sha256t_hash_newtype!
macro for creating tagged hashes
- Update MSRV to 1.29.0
- Add
as_inner
method toHash
trait - Add
n_bytes_hashed
toHashEngine
trait
- Support hash newtypes with reversed hex serialization.
- Add
sha256t
module for SHA-256-based tagged hashes. - Add
FromStr
for hash newtypes. - Add
from_hash
for hash newtypes.
- Add
as_hash(&self) -> <inner>
method to hash newtypes.
- Make the inner variable of
sha256::Midstat
public - Drop the
byteorder
dependency in favor of manual endianness implementations (later this will be in stdlib so we can drop even that) - Fix the
hash_newtype
macro, which did not compile before
- Add hash_newtype macro that allows third parties to create newtype structs.
- Add
hex::Error
type for errors generated by thehex
module.
- Add
no_std
support, rearrange traits to not depend onio::Write
- Fix panic when parsing hashes that contain multibyte characters
- Add
FromStr
to all hashes which hex-parses them
- Add
from_inner
method to all hashes - Update
FromHex
trait to requirefrom_byte_iter
method rather thanfrom_hex
be implemented - Make
Hmac
midstate an actual HMAC midstate - Allow
Display
of truncated hashes - Require using a constructor for
HexIterator
and then clean up the internals - Strongly type
sha256::Midstate
to allow independent serialization - Add siphash24 module
- Implement the
FromHex
trait on many more types
- Bump minimum required rustc version to 1.22.0
- Fixed serde deserialization into owned string that previously caused panics when doing round-trip (de)serialization
HashEngine::block_size()
andHash::len()
are now associated constantsHashEngine::BLOCK_SIZE
andHash::LEN
- Removed
block_size()
method fromHash
trait. It is still available as<T as Hash>::Engine::BLOCK_SIZE
- Add a constant-time comparison function
- Simplify
io::Write::write
implementations by having them do only partial writes - Add fuzzing support
- Allow
Hash
es to be borrowed as[u8]
- Replace public
Hash
inners withinto_inner
method
- Initial release