diff --git a/noir_stdlib/src/ec/consts/te.nr b/noir_stdlib/src/ec/consts/te.nr index 349e518cdb2..e82302eadee 100644 --- a/noir_stdlib/src/ec/consts/te.nr +++ b/noir_stdlib/src/ec/consts/te.nr @@ -8,6 +8,7 @@ pub struct BabyJubjub { } #[field(bn254)] +#[deprecated = "It's recommmended to use the external noir-edwards library (https://github.com/noir-lang/noir-edwards)"] pub fn baby_jubjub() -> BabyJubjub { BabyJubjub { // Baby Jubjub (ERC-2494) parameters in affine representation diff --git a/noir_stdlib/src/ec/tecurve.nr b/noir_stdlib/src/ec/tecurve.nr index b306873806d..f9cdf83aab9 100644 --- a/noir_stdlib/src/ec/tecurve.nr +++ b/noir_stdlib/src/ec/tecurve.nr @@ -27,6 +27,7 @@ mod affine { impl Point { // Point constructor + #[deprecated = "It's recommmended to use the external noir-edwards library (https://github.com/noir-lang/noir-edwards)"] pub fn new(x: Field, y: Field) -> Self { Self { x, y } } diff --git a/noir_stdlib/src/hash/mimc.nr b/noir_stdlib/src/hash/mimc.nr index 8c43536d18b..1bcc9e3fcc7 100644 --- a/noir_stdlib/src/hash/mimc.nr +++ b/noir_stdlib/src/hash/mimc.nr @@ -6,6 +6,7 @@ use crate::default::Default; // You must use constants generated for the native field // Rounds number should be ~ log(p)/log(exp) // For 254 bit primes, exponent 7 and 91 rounds seems to be recommended +#[deprecated = "It's recommmended to use the external MiMC library (https://github.com/noir-lang/mimc)"] fn mimc(x: Field, k: Field, constants: [Field; N], exp: Field) -> Field { //round 0 let mut t = x + k; @@ -116,6 +117,7 @@ global MIMC_BN254_CONSTANTS: [Field; MIMC_BN254_ROUNDS] = [ //mimc implementation with hardcoded parameters for BN254 curve. #[field(bn254)] +#[deprecated = "It's recommmended to use the external MiMC library (https://github.com/noir-lang/mimc)"] pub fn mimc_bn254(array: [Field; N]) -> Field { let exponent = 7; let mut r = 0; diff --git a/noir_stdlib/src/hash/sha256.nr b/noir_stdlib/src/hash/sha256.nr index e712019b5cc..413c26d6f6b 100644 --- a/noir_stdlib/src/hash/sha256.nr +++ b/noir_stdlib/src/hash/sha256.nr @@ -8,7 +8,7 @@ use crate::runtime::is_unconstrained; pub fn sha256(input: [u8; N]) -> [u8; 32] // docs:end:sha256 { - crate::sha256::digest(input) + digest(input) } #[foreign(sha256_compression)] diff --git a/noir_stdlib/src/schnorr.nr b/noir_stdlib/src/schnorr.nr index 336041fec19..e24aabf3cda 100644 --- a/noir_stdlib/src/schnorr.nr +++ b/noir_stdlib/src/schnorr.nr @@ -1,4 +1,3 @@ -use crate::collections::vec::Vec; use crate::embedded_curve_ops::{EmbeddedCurvePoint, EmbeddedCurveScalar}; #[foreign(schnorr_verify)] @@ -23,7 +22,11 @@ pub fn verify_signature_slice( // docs:end:schnorr_verify_slice {} -pub fn verify_signature_noir(public_key: EmbeddedCurvePoint, signature: [u8; 64], message: [u8; N]) -> bool { +pub fn verify_signature_noir( + public_key: EmbeddedCurvePoint, + signature: [u8; 64], + message: [u8; N] +) -> bool { //scalar lo/hi from bytes let sig_s = EmbeddedCurveScalar::from_bytes(signature, 0); let sig_e = EmbeddedCurveScalar::from_bytes(signature, 32); @@ -42,7 +45,11 @@ pub fn verify_signature_noir(public_key: EmbeddedCurvePoint, signatu is_ok } -pub fn assert_valid_signature(public_key: EmbeddedCurvePoint, signature: [u8; 64], message: [u8; N]) { +pub fn assert_valid_signature( + public_key: EmbeddedCurvePoint, + signature: [u8; 64], + message: [u8; N] +) { //scalar lo/hi from bytes let sig_s = EmbeddedCurveScalar::from_bytes(signature, 0); let sig_e = EmbeddedCurveScalar::from_bytes(signature, 32); diff --git a/noir_stdlib/src/sha256.nr b/noir_stdlib/src/sha256.nr index ce217f7a689..7679e517317 100644 --- a/noir_stdlib/src/sha256.nr +++ b/noir_stdlib/src/sha256.nr @@ -1,2 +1,11 @@ // This file is kept for backwards compatibility. -pub use crate::hash::sha256::{digest, sha256_var}; + +#[deprecated = "replace with std::hash::sha256::digest"] +pub fn digest(msg: [u8; N]) -> [u8; 32] { + crate::hash::sha256::digest(msg) +} + +#[deprecated = "replace with std::hash::sha256::sha256_var"] +pub fn sha256_var(msg: [u8; N], message_size: u64) -> [u8; 32] { + crate::hash::sha256::sha256_var(msg, message_size) +} diff --git a/noir_stdlib/src/sha512.nr b/noir_stdlib/src/sha512.nr index b474e27b416..0a8a5bf4760 100644 --- a/noir_stdlib/src/sha512.nr +++ b/noir_stdlib/src/sha512.nr @@ -1,2 +1,6 @@ // This file is kept for backwards compatibility. -pub use crate::hash::sha512::digest; + +#[deprecated = "replace with std::hash::sha512::digest"] +pub fn digest(msg: [u8; N]) -> [u8; 64] { + crate::hash::sha512::digest(msg) +}