-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak code, add readme and changelog
- Loading branch information
Showing
9 changed files
with
268 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## 0.1.0 (2023-06-11) | ||
- Initial release ([#484]) | ||
|
||
[#484]: https://github.com/RustCrypto/hashes/pull/484 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# RustCrypto: JH | ||
|
||
[![crate][crate-image]][crate-link] | ||
[![Docs][docs-image]][docs-link] | ||
![Apache2/MIT licensed][license-image] | ||
![Rust Version][rustc-image] | ||
[![Project Chat][chat-image]][chat-link] | ||
[![Build Status][build-image]][build-link] | ||
|
||
Pure Rust implementation of the [JH] cryptographic hash function. | ||
|
||
[Documentation][docs-link] | ||
|
||
## Minimum Supported Rust Version | ||
|
||
Rust **1.57** or higher. | ||
|
||
Minimum supported Rust version can be changed in the future, but it will be | ||
done with a minor version bump. | ||
|
||
## SemVer Policy | ||
|
||
- All on-by-default features of this library are covered by SemVer | ||
- MSRV is considered exempt from SemVer as noted above | ||
|
||
## License | ||
|
||
Licensed under either of: | ||
|
||
* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) | ||
* [MIT license](http://opensource.org/licenses/MIT) | ||
|
||
at your option. | ||
|
||
### Contribution | ||
|
||
Unless you explicitly state otherwise, any contribution intentionally submitted | ||
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be | ||
dual licensed as above, without any additional terms or conditions. | ||
|
||
[//]: # (badges) | ||
|
||
[crate-image]: https://img.shields.io/crates/v/jh.svg | ||
[crate-link]: https://crates.io/crates/jh | ||
[docs-image]: https://docs.rs/jh/badge.svg | ||
[docs-link]: https://docs.rs/jh/ | ||
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg | ||
[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg | ||
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg | ||
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes | ||
[build-image]: https://github.com/RustCrypto/hashes/workflows/jh/badge.svg?branch=master | ||
[build-link]: https://github.com/RustCrypto/hashes/actions?query=workflow%jh | ||
|
||
[//]: # (general links) | ||
|
||
[JH]: https://en.wikipedia.org/wiki/JH_(hash_function) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,74 @@ | ||
use hex_literal::hex; | ||
|
||
pub const JH224_H0: [u8; 128] = hex!( | ||
"2dfedd62f99a98acae7cacd619d634e7a4831005bc301216b86038c6c966149466d9899f2580706fce9ea31b1d9b1adc11e8325f7b366e10f994857f02fa06c1" | ||
"1b4f1b5cd8c840b397f6a17f6e738099dcdf93a5adeaa3d3a431e8dec9539a6822b4a98aec86a1e4d574ac959ce56cf015960deab5ab2bbf9611dcf0dd64ea6e" | ||
pub(crate) const JH224_H0: [u8; 128] = hex!( | ||
"2dfedd62f99a98acae7cacd619d634e7a4831005bc301216b86038c6c9661494" | ||
"66d9899f2580706fce9ea31b1d9b1adc11e8325f7b366e10f994857f02fa06c1" | ||
"1b4f1b5cd8c840b397f6a17f6e738099dcdf93a5adeaa3d3a431e8dec9539a68" | ||
"22b4a98aec86a1e4d574ac959ce56cf015960deab5ab2bbf9611dcf0dd64ea6e" | ||
); | ||
|
||
pub const JH256_H0: [u8; 128] = hex!( | ||
"eb98a3412c20d3eb92cdbe7b9cb245c11c93519160d4c7fa260082d67e508a03a4239e267726b945e0fb1a48d41a9477cdb5ab26026b177a56f024420fff2fa8" | ||
"71a396897f2e4d751d144908f77de262277695f776248f9487d5b6574780296c5c5e272dac8e0d6c518450c657057a0f7be4d367702412ea89e3ab13d31cd769" | ||
pub(crate) const JH256_H0: [u8; 128] = hex!( | ||
"eb98a3412c20d3eb92cdbe7b9cb245c11c93519160d4c7fa260082d67e508a03" | ||
"a4239e267726b945e0fb1a48d41a9477cdb5ab26026b177a56f024420fff2fa8" | ||
"71a396897f2e4d751d144908f77de262277695f776248f9487d5b6574780296c" | ||
"5c5e272dac8e0d6c518450c657057a0f7be4d367702412ea89e3ab13d31cd769" | ||
); | ||
|
||
pub const JH384_H0: [u8; 128] = hex!( | ||
"481e3bc6d813398a6d3b5e894ade879b63faea68d480ad2e332ccb21480f826798aec84d9082b928d455ea304111424936f555b2924847ecc7250a93baf43ce1" | ||
"569b7f8a27db454c9efcbd496397af0e589fc27d26aa80cd80c08b8c9deb2eda8a7981e8f8d5373af43967adddd17a71a9b4d3bda475d394976c3fba9842737f" | ||
pub(crate) const JH384_H0: [u8; 128] = hex!( | ||
"481e3bc6d813398a6d3b5e894ade879b63faea68d480ad2e332ccb21480f8267" | ||
"98aec84d9082b928d455ea304111424936f555b2924847ecc7250a93baf43ce1" | ||
"569b7f8a27db454c9efcbd496397af0e589fc27d26aa80cd80c08b8c9deb2eda" | ||
"8a7981e8f8d5373af43967adddd17a71a9b4d3bda475d394976c3fba9842737f" | ||
); | ||
|
||
pub const JH512_H0: [u8; 128] = hex!( | ||
"6fd14b963e00aa17636a2e057a15d5438a225e8d0c97ef0be9341259f2b3c361891da0c1536f801e2aa9056bea2b6d80588eccdb2075baa6a90f3a76baf83bf7" | ||
"0169e60541e34a6946b58a8e2e6fe65a1047a7d0c1843c243b6e71b12d5ac199cf57f6ec9db1f856a706887c5716b156e3c2fcdfe68517fb545a4678cc8cdd4b" | ||
pub(crate) const JH512_H0: [u8; 128] = hex!( | ||
"6fd14b963e00aa17636a2e057a15d5438a225e8d0c97ef0be9341259f2b3c361" | ||
"891da0c1536f801e2aa9056bea2b6d80588eccdb2075baa6a90f3a76baf83bf7" | ||
"0169e60541e34a6946b58a8e2e6fe65a1047a7d0c1843c243b6e71b12d5ac199" | ||
"cf57f6ec9db1f856a706887c5716b156e3c2fcdfe68517fb545a4678cc8cdd4b" | ||
); | ||
|
||
pub(crate) const E8_BITSLICE_ROUNDCONSTANT: [[u8; 32]; 42] = [ | ||
hex!("72d5dea2df15f8677b84150ab723155781abd6904d5a87f64e9f4fc5c3d12b40"), | ||
hex!("ea983ae05c45fa9c03c5d29966b2999a660296b4f2bb538ab556141a88dba231"), | ||
hex!("03a35a5c9a190edb403fb20a87c144101c051980849e951d6f33ebad5ee7cddc"), | ||
hex!("10ba139202bf6b41dc786515f7bb27d00a2c813937aa78503f1abfd2410091d3"), | ||
hex!("422d5a0df6cc7e90dd629f9c92c097ce185ca70bc72b44acd1df65d663c6fc23"), | ||
hex!("976e6c039ee0b81a2105457e446ceca8eef103bb5d8e61fafd9697b294838197"), | ||
hex!("4a8e8537db03302f2a678d2dfb9f6a958afe7381f8b8696c8ac77246c07f4214"), | ||
hex!("c5f4158fbdc75ec475446fa78f11bb8052de75b7aee488bc82b8001e98a6a3f4"), | ||
hex!("8ef48f33a9a36315aa5f5624d5b7f989b6f1ed207c5ae0fd36cae95a06422c36"), | ||
hex!("ce2935434efe983d533af974739a4ba7d0f51f596f4e81860e9dad81afd85a9f"), | ||
hex!("a7050667ee34626a8b0b28be6eb9172747740726c680103fe0a07e6fc67e487b"), | ||
hex!("0d550aa54af8a4c091e3e79f978ef19e8676728150608dd47e9e5a41f3e5b062"), | ||
hex!("fc9f1fec4054207ae3e41a00cef4c9844fd794f59dfa95d8552e7e1124c354a5"), | ||
hex!("5bdf7228bdfe6e2878f57fe20fa5c4b205897cefee49d32e447e9385eb28597f"), | ||
hex!("705f6937b324314a5e8628f11dd6e465c71b770451b920e774fe43e823d4878a"), | ||
hex!("7d29e8a3927694f2ddcb7a099b30d9c11d1b30fb5bdc1be0da24494ff29c82bf"), | ||
hex!("a4e7ba31b470bfff0d324405def8bc483baefc3253bbd339459fc3c1e0298ba0"), | ||
hex!("e5c905fdf7ae090f947034124290f134a271b701e344ed95e93b8e364f2f984a"), | ||
hex!("88401d63a06cf61547c1444b8752afff7ebb4af1e20ac6304670b6c5cc6e8ce6"), | ||
hex!("a4d5a456bd4fca00da9d844bc83e18ae7357ce453064d1ade8a6ce68145c2567"), | ||
hex!("a3da8cf2cb0ee11633e906589a94999a1f60b220c26f847bd1ceac7fa0d18518"), | ||
hex!("32595ba18ddd19d3509a1cc0aaa5b4469f3d6367e4046bbaf6ca19ab0b56ee7e"), | ||
hex!("1fb179eaa9282174e9bdf7353b3651ee1d57ac5a7550d3763a46c2fea37d7001"), | ||
hex!("f735c1af98a4d84278edec209e6b677941836315ea3adba8fac33b4d32832c83"), | ||
hex!("a7403b1f1c2747f35940f034b72d769ae73e4e6cd2214ffdb8fd8d39dc5759ef"), | ||
hex!("8d9b0c492b49ebda5ba2d74968f3700d7d3baed07a8d5584f5a5e9f0e4f88e65"), | ||
hex!("a0b8a2f436103b530ca8079e753eec5a9168949256e8884f5bb05c55f8babc4c"), | ||
hex!("e3bb3b99f387947b75daf4d6726b1c5d64aeac28dc34b36d6c34a550b828db71"), | ||
hex!("f861e2f2108d512ae3db643359dd75fc1cacbcf143ce3fa267bbd13c02e843b0"), | ||
hex!("330a5bca8829a1757f34194db416535c923b94c30e794d1e797475d7b6eeaf3f"), | ||
hex!("eaa8d4f7be1a39215cf47e094c23275126a32453ba323cd244a3174a6da6d5ad"), | ||
hex!("b51d3ea6aff2c90883593d98916b3c564cf87ca17286604d46e23ecc086ec7f6"), | ||
hex!("2f9833b3b1bc765e2bd666a5efc4e62a06f4b6e8bec1d43674ee8215bcef2163"), | ||
hex!("fdc14e0df453c969a77d5ac4065858267ec1141606e0fa167e90af3d28639d3f"), | ||
hex!("d2c9f2e3009bd20c5faace30b7d40c30742a5116f2e032980deb30d8e3cef89a"), | ||
hex!("4bc59e7bb5f17992ff51e66e048668d39b234d57e6966731cce6a6f3170a7505"), | ||
hex!("b17681d913326cce3c175284f805a262f42bcbb378471547ff46548223936a48"), | ||
hex!("38df58074e5e6565f2fc7c89fc86508e31702e44d00bca86f04009a23078474e"), | ||
hex!("65a0ee39d1f73883f75ee937e42c3abd2197b2260113f86fa344edd1ef9fdee7"), | ||
hex!("8ba0df15762592d93c85f7f612dc42bed8a7ec7cab27b07e538d7ddaaa3ea8de"), | ||
hex!("aa25ce93bd0269d85af643fd1a7308f9c05fefda174a19a5974d66334cfd216a"), | ||
hex!("35b49831db411570ea1e0fbbedcd549b9ad063a151974072f6759dbf91476fe2"), | ||
]; |
Oops, something went wrong.