Skip to content

Commit b9c6ee5

Browse files
authored
Merge a657c7f into 68f3022
2 parents 68f3022 + a657c7f commit b9c6ee5

File tree

7 files changed

+30
-6
lines changed

7 files changed

+30
-6
lines changed

noir_stdlib/src/ec/consts/te.nr

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub struct BabyJubjub {
88
}
99

1010
#[field(bn254)]
11+
#[deprecated = "It's recommmended to use the external noir-edwards library (https://github.com/noir-lang/noir-edwards)"]
1112
pub fn baby_jubjub() -> BabyJubjub {
1213
BabyJubjub {
1314
// Baby Jubjub (ERC-2494) parameters in affine representation

noir_stdlib/src/ec/tecurve.nr

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ mod affine {
2727

2828
impl Point {
2929
// Point constructor
30+
#[deprecated = "It's recommmended to use the external noir-edwards library (https://github.com/noir-lang/noir-edwards)"]
3031
pub fn new(x: Field, y: Field) -> Self {
3132
Self { x, y }
3233
}

noir_stdlib/src/hash/mimc.nr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::default::Default;
66
// You must use constants generated for the native field
77
// Rounds number should be ~ log(p)/log(exp)
88
// For 254 bit primes, exponent 7 and 91 rounds seems to be recommended
9+
#[deprecated = "It's recommmended to use the external MiMC library (https://github.com/noir-lang/mimc)"]
910
fn mimc<let N: u32>(x: Field, k: Field, constants: [Field; N], exp: Field) -> Field {
1011
//round 0
1112
let mut t = x + k;
@@ -116,6 +117,7 @@ global MIMC_BN254_CONSTANTS: [Field; MIMC_BN254_ROUNDS] = [
116117

117118
//mimc implementation with hardcoded parameters for BN254 curve.
118119
#[field(bn254)]
120+
#[deprecated = "It's recommmended to use the external MiMC library (https://github.com/noir-lang/mimc)"]
119121
pub fn mimc_bn254<let N: u32>(array: [Field; N]) -> Field {
120122
let exponent = 7;
121123
let mut r = 0;

noir_stdlib/src/hash/sha256.nr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::runtime::is_unconstrained;
88
pub fn sha256<let N: u32>(input: [u8; N]) -> [u8; 32]
99
// docs:end:sha256
1010
{
11-
crate::sha256::digest(input)
11+
digest(input)
1212
}
1313

1414
#[foreign(sha256_compression)]

noir_stdlib/src/schnorr.nr

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::collections::vec::Vec;
21
use crate::embedded_curve_ops::{EmbeddedCurvePoint, EmbeddedCurveScalar};
32

43
#[foreign(schnorr_verify)]
@@ -23,7 +22,11 @@ pub fn verify_signature_slice(
2322
// docs:end:schnorr_verify_slice
2423
{}
2524

26-
pub fn verify_signature_noir<let N: u32>(public_key: EmbeddedCurvePoint, signature: [u8; 64], message: [u8; N]) -> bool {
25+
pub fn verify_signature_noir<let N: u32>(
26+
public_key: EmbeddedCurvePoint,
27+
signature: [u8; 64],
28+
message: [u8; N]
29+
) -> bool {
2730
//scalar lo/hi from bytes
2831
let sig_s = EmbeddedCurveScalar::from_bytes(signature, 0);
2932
let sig_e = EmbeddedCurveScalar::from_bytes(signature, 32);
@@ -42,7 +45,11 @@ pub fn verify_signature_noir<let N: u32>(public_key: EmbeddedCurvePoint, signatu
4245
is_ok
4346
}
4447

45-
pub fn assert_valid_signature<let N: u32>(public_key: EmbeddedCurvePoint, signature: [u8; 64], message: [u8; N]) {
48+
pub fn assert_valid_signature<let N: u32>(
49+
public_key: EmbeddedCurvePoint,
50+
signature: [u8; 64],
51+
message: [u8; N]
52+
) {
4653
//scalar lo/hi from bytes
4754
let sig_s = EmbeddedCurveScalar::from_bytes(signature, 0);
4855
let sig_e = EmbeddedCurveScalar::from_bytes(signature, 32);

noir_stdlib/src/sha256.nr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
// This file is kept for backwards compatibility.
2-
pub use crate::hash::sha256::{digest, sha256_var};
2+
3+
#[deprecated = "replace with std::hash::sha256::digest"]
4+
pub fn digest<let N: u32>(msg: [u8; N]) -> [u8; 32] {
5+
crate::hash::sha256::digest(msg)
6+
}
7+
8+
#[deprecated = "replace with std::hash::sha256::sha256_var"]
9+
pub fn sha256_var<let N: u32>(msg: [u8; N], message_size: u64) -> [u8; 32] {
10+
crate::hash::sha256::sha256_var(msg, message_size)
11+
}

noir_stdlib/src/sha512.nr

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
// This file is kept for backwards compatibility.
2-
pub use crate::hash::sha512::digest;
2+
3+
#[deprecated = "replace with std::hash::sha512::digest"]
4+
pub fn digest<let N: u32>(msg: [u8; N]) -> [u8; 64] {
5+
crate::hash::sha512::digest(msg)
6+
}

0 commit comments

Comments
 (0)