Skip to content

Commit 1545e35

Browse files
committed
Correct bandersnatch padding point
1 parent ebbb0dc commit 1545e35

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/ring.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ where
337337
#[cfg(test)]
338338
pub(crate) mod testing {
339339
use super::*;
340-
use crate::{pedersen, testing as common};
340+
use crate::pedersen;
341+
use crate::testing::{self as common, PADDING_SEED, TEST_SEED};
341342

342343
pub const TEST_RING_SIZE: usize = 8;
343344

@@ -351,7 +352,7 @@ pub(crate) mod testing {
351352
let rng = &mut ark_std::test_rng();
352353
let ring_ctx = RingContext::<S>::from_rand(TEST_RING_SIZE, rng);
353354

354-
let secret = Secret::<S>::from_seed(common::TEST_SEED);
355+
let secret = Secret::<S>::from_seed(TEST_SEED);
355356
let public = secret.public();
356357
let input = Input::from(common::random_val(Some(rng)));
357358
let output = secret.output(input);
@@ -379,7 +380,6 @@ pub(crate) mod testing {
379380
CurveConfig<S>: TECurveConfig + Clone,
380381
AffinePoint<S>: TEMapping<CurveConfig<S>>,
381382
{
382-
const PADDING_SEED: &[u8] = b"w3f/ring-proof/padding";
383383
let p = S::data_to_point(PADDING_SEED).unwrap();
384384
assert_eq!(S::PADDING, p);
385385
}

src/suites/bandersnatch.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ pub mod weierstrass {
108108

109109
const PADDING: AffinePoint = {
110110
const X: weierstrass::BaseField = MontFp!(
111-
"46773150013419170039927491869621293654549314356406233983762580404134261753450"
111+
"35708930000861830245548017565786725469855815091650767855130736125157313721963"
112112
);
113113
const Y: weierstrass::BaseField = MontFp!(
114-
"22599467115101261434854217219446263536674031843145074147602916161466662885286"
114+
"6338347876957125643073931899147877399239458581517971209321056997700389681947"
115115
);
116116
AffinePoint::new_unchecked(X, Y)
117117
};
@@ -192,10 +192,10 @@ pub mod edwards {
192192

193193
const PADDING: AffinePoint = {
194194
const X: edwards::BaseField = MontFp!(
195-
"26690044630372444677440308098946018389016038587388751811165279176488605875833"
195+
"28750114660840472435108695402615748045574467283805097196439027458114890954346"
196196
);
197197
const Y: edwards::BaseField = MontFp!(
198-
"569559155228528470326092120674498621727733902430463954153034712442147510565"
198+
"28681665303008045500432480596307870740664482088334198476809598411704602209439"
199199
);
200200
AffinePoint::new_unchecked(X, Y)
201201
};

0 commit comments

Comments
 (0)