Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Conversation

@apoelstra
Copy link
Member

@apoelstra apoelstra commented Jul 5, 2019

When no_std is on we lose the io::Write impls on all the hash engines, naturally, as well as the std::error::Error impl on Error.

We also lose the ToHex trait, since this outputs a String, though we retain the format_hex function as well as fmt::{Display, LowerHex, UpperHex} for all hashes.

Fixes #12

apoelstra added 2 commits July 7, 2019 15:17
This was saving a very small amount of code and will make it difficult
to refactor the `write` function into the `input` function in the next
commit.
@apoelstra
Copy link
Member Author

Rebased, fixed build failure with --features "fuzztarget", added no_std build test to Travis

@apoelstra
Copy link
Member Author

Removed redundant fuzztarget/nonfuzztarget siphash24::midstate

@stevenroose
Copy link
Collaborator

Is there a specific reason why you implemented input for each hash instead of using a macro like there was for write_impl? Could have prevented a bit of code duplication.

Otherwise ACK.

@apoelstra
Copy link
Member Author

It was just short, and all the duplication was in one file right next to each other. If I need to change it I'll convert it to a macro.

@apoelstra
Copy link
Member Author

Added a commit to bump the version number.

@sgeisler am I ok to merge?

@elichai
Copy link
Member

elichai commented Jul 10, 2019

If anyone really wants the ToHex trait, they could try and maybe make it similar to this https://github.com/debris/rustc-hex/blob/master/src/lib.rs#L31
(generic over FromIterator<char>)

Copy link
Member

@dongcarl dongcarl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably cherry-pick dongcarl@01ae9cb for proper propagation of {no_,}std, can also cherry-pick dongcarl@4ac63b7

dongcarl added 2 commits July 10, 2019 18:31
This was previously removed to aid restructuring, but should be added
back so we don't have to remember to modify every HashEngine every time
we modify the input function.
@apoelstra
Copy link
Member Author

cherry-picked both. Thanks!

@dongcarl
Copy link
Member

ACK eac6cde

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-std mode

6 participants