diff --git a/noir_stdlib/src/hash/sha256.nr b/noir_stdlib/src/hash/sha256.nr index fce263ce25d..1bbeada3431 100644 --- a/noir_stdlib/src/hash/sha256.nr +++ b/noir_stdlib/src/hash/sha256.nr @@ -43,8 +43,8 @@ type HASH = [u8; 32]; // Its overall size is the same as the `HASH`. type STATE = [u32; 8]; -// Deprecated in favour of `sha256_var` // docs:start:sha256 +#[deprecated("sha256 is being deprecated from the stdlib, use https://github.com/noir-lang/sha256 instead")] pub fn sha256(input: [u8; N]) -> HASH // docs:end:sha256 { @@ -56,11 +56,13 @@ pub fn sha256_compression(_input: INT_BLOCK, _state: STATE) -> STATE {} // SHA-256 hash function #[no_predicates] +#[deprecated("sha256 is being deprecated from the stdlib, use https://github.com/noir-lang/sha256 instead")] pub fn digest(msg: [u8; N]) -> HASH { sha256_var(msg, N as u64) } // Variable size SHA-256 hash +#[deprecated("sha256 is being deprecated from the stdlib, use https://github.com/noir-lang/sha256 instead")] pub fn sha256_var(msg: [u8; N], message_size: u64) -> HASH { let message_size = message_size as u32; let num_blocks = N / BLOCK_SIZE; diff --git a/noir_stdlib/src/sha256.nr b/noir_stdlib/src/sha256.nr index 9e07b690c4c..534c954d3dc 100644 --- a/noir_stdlib/src/sha256.nr +++ b/noir_stdlib/src/sha256.nr @@ -1,10 +1,10 @@ // This file is kept for backwards compatibility. -#[deprecated] +#[deprecated("sha256 is being deprecated from the stdlib, use https://github.com/noir-lang/sha256 instead")] pub fn digest(msg: [u8; N]) -> [u8; 32] { crate::hash::sha256::digest(msg) } -#[deprecated] +#[deprecated("sha256 is being deprecated from the stdlib, use https://github.com/noir-lang/sha256 instead")] pub fn sha256_var(msg: [u8; N], message_size: u64) -> [u8; 32] { crate::hash::sha256::sha256_var(msg, message_size) }