Add note about whether sign checks in Amount -> Fr conversion matter
Co-authored-by: Henry de Valence <hdevalence@hdevalence.ca>
This commit is contained in:
parent
75cad3bb0a
commit
52a10d2837
|
@ -134,6 +134,7 @@ impl From<Amount<NonNegative>> for u64 {
|
||||||
|
|
||||||
impl<C> From<Amount<C>> for jubjub::Fr {
|
impl<C> From<Amount<C>> for jubjub::Fr {
|
||||||
fn from(a: Amount<C>) -> jubjub::Fr {
|
fn from(a: Amount<C>) -> jubjub::Fr {
|
||||||
|
// TODO: this isn't constant time -- does that matter?
|
||||||
if a.0 < 0 {
|
if a.0 < 0 {
|
||||||
jubjub::Fr::from(a.0.abs() as u64).neg()
|
jubjub::Fr::from(a.0.abs() as u64).neg()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue