mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-09 15:41:30 +01:00
feat: re-export winter-crypto Hasher, Digest & ElementHasher
This commit introduces the re-export of the listed primitives. They will be used inside Miden to report the security level of the picked primitive, as well as other functionality. closes #72
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 0.1.4 (2023-02-22)
|
||||||
|
|
||||||
|
- Re-export winter-crypto Hasher, Digest & ElementHasher (#72)
|
||||||
|
|
||||||
## 0.1.3 (2023-02-20)
|
## 0.1.3 (2023-02-20)
|
||||||
|
|
||||||
- Updated Winterfell dependency to v0.5.1 (#68)
|
- Updated Winterfell dependency to v0.5.1 (#68)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "miden-crypto"
|
name = "miden-crypto"
|
||||||
version = "0.1.3"
|
version = "0.1.5"
|
||||||
description = "Miden Cryptographic primitives"
|
description="Miden Cryptographic primitives"
|
||||||
authors = ["miden contributors"]
|
authors = ["miden contributors"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ impl<const N: usize> Digest for Blake3Digest<N> {
|
|||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
|
||||||
/// 256-bit output blake3 hasher.
|
/// 256-bit output blake3 hasher.
|
||||||
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||||
pub struct Blake3_256;
|
pub struct Blake3_256;
|
||||||
|
|
||||||
impl Hasher for Blake3_256 {
|
impl Hasher for Blake3_256 {
|
||||||
@@ -141,6 +142,7 @@ impl Blake3_256 {
|
|||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
|
||||||
/// 192-bit output blake3 hasher.
|
/// 192-bit output blake3 hasher.
|
||||||
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||||
pub struct Blake3_192;
|
pub struct Blake3_192;
|
||||||
|
|
||||||
impl Hasher for Blake3_192 {
|
impl Hasher for Blake3_192 {
|
||||||
@@ -204,6 +206,7 @@ impl Blake3_192 {
|
|||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
|
||||||
/// 160-bit output blake3 hasher.
|
/// 160-bit output blake3 hasher.
|
||||||
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||||
pub struct Blake3_160;
|
pub struct Blake3_160;
|
||||||
|
|
||||||
impl Hasher for Blake3_160 {
|
impl Hasher for Blake3_160 {
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
use super::{Felt, FieldElement, StarkField, ONE, ZERO};
|
use super::{Felt, FieldElement, StarkField, ONE, ZERO};
|
||||||
use winter_crypto::{Digest, ElementHasher, Hasher};
|
|
||||||
|
|
||||||
pub mod blake;
|
pub mod blake;
|
||||||
pub mod rpo;
|
pub mod rpo;
|
||||||
|
|
||||||
|
// RE-EXPORTS
|
||||||
|
// ================================================================================================
|
||||||
|
|
||||||
|
pub use winter_crypto::{Digest, ElementHasher, Hasher};
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ const INV_ALPHA: u64 = 10540996611094048183;
|
|||||||
/// to deserialize them into field elements and then hash them using
|
/// to deserialize them into field elements and then hash them using
|
||||||
/// [hash_elements()](Rpo256::hash_elements) function rather then hashing the serialized bytes
|
/// [hash_elements()](Rpo256::hash_elements) function rather then hashing the serialized bytes
|
||||||
/// using [hash()](Rpo256::hash) function.
|
/// using [hash()](Rpo256::hash) function.
|
||||||
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||||
pub struct Rpo256();
|
pub struct Rpo256();
|
||||||
|
|
||||||
impl Hasher for Rpo256 {
|
impl Hasher for Rpo256 {
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ pub mod merkle;
|
|||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
|
||||||
pub use winter_crypto::{RandomCoin, RandomCoinError};
|
pub use winter_crypto::{RandomCoin, RandomCoinError};
|
||||||
|
|
||||||
pub use winter_math::{fields::f64::BaseElement as Felt, FieldElement, StarkField};
|
pub use winter_math::{fields::f64::BaseElement as Felt, FieldElement, StarkField};
|
||||||
|
|
||||||
pub mod utils {
|
pub mod utils {
|
||||||
pub use winter_utils::{
|
pub use winter_utils::{
|
||||||
collections, string, uninit_vector, ByteReader, ByteWriter, Deserializable,
|
collections, string, uninit_vector, ByteReader, ByteWriter, Deserializable,
|
||||||
|
|||||||
Reference in New Issue
Block a user