1
- use super :: { add, util , CellValue , EccConfig , EccPoint } ;
1
+ use super :: { add, copy , CellValue , EccConfig , EccPoint , Var } ;
2
2
use crate :: constants:: NUM_COMPLETE_BITS ;
3
3
use std:: ops:: { Deref , Range } ;
4
4
@@ -113,7 +113,7 @@ impl<C: CurveAffine> Config<C> {
113
113
let offset = offset + 1 ;
114
114
115
115
// Decompose the scalar bitwise (big-endian bit order).
116
- let bits = decompose_for_scalar_mul :: < C > ( scalar. value ) ;
116
+ let bits = decompose_for_scalar_mul :: < C > ( scalar. value ( ) ) ;
117
117
118
118
// Initialize the running sum for scalar decomposition to zero
119
119
let z_val = C :: Base :: zero ( ) ;
@@ -131,7 +131,7 @@ impl<C: CurveAffine> Config<C> {
131
131
offset,
132
132
& base,
133
133
bits_incomplete_hi,
134
- ( X ( acc. x . clone ( ) ) , Y ( acc. y . value ) , Z ( z) ) ,
134
+ ( X ( acc. x . clone ( ) ) , Y ( acc. y . value ( ) ) , Z ( z) ) ,
135
135
) ?;
136
136
137
137
// Double-and-add (incomplete addition) for the `lo` half of the scalar decomposition
@@ -164,7 +164,7 @@ impl<C: CurveAffine> Config<C> {
164
164
} ;
165
165
166
166
// Initialize `z` running sum for complete addition
167
- util :: assign_and_constrain (
167
+ copy (
168
168
region,
169
169
|| "Initialize `z` running sum for complete addition" ,
170
170
self . z_complete ,
@@ -182,7 +182,7 @@ impl<C: CurveAffine> Config<C> {
182
182
// Bits used in complete addition. k_{3} to k_{1} inclusive
183
183
// The LSB k_{0} is handled separately.
184
184
let bits_complete = & bits[ complete_range :: < C > ( ) ] ;
185
- complete_config. assign_region ( region, offset, bits_complete, base, acc, z. value ) ?
185
+ complete_config. assign_region ( region, offset, bits_complete, base, acc, z. value ( ) ) ?
186
186
} ;
187
187
188
188
let offset = offset + complete_len :: < C > ( ) * 2 ;
@@ -198,7 +198,7 @@ impl<C: CurveAffine> Config<C> {
198
198
199
199
let base = base. point ( ) ;
200
200
let scalar = scalar
201
- . value
201
+ . value ( )
202
202
. map ( |scalar| C :: Scalar :: from_bytes ( & scalar. to_bytes ( ) ) . unwrap ( ) ) ;
203
203
let real_mul = base. zip ( scalar) . map ( |( base, scalar) | base * scalar) ;
204
204
let result = result. point ( ) ;
@@ -241,7 +241,7 @@ impl<C: CurveAffine> Config<C> {
241
241
// is in deriving diversified addresses `[ivk] g_d`, and `ivk` is guaranteed
242
242
// to be in the base field of the curve. (See non-normative notes in
243
243
// https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents.)
244
- util :: assign_and_constrain (
244
+ copy (
245
245
region,
246
246
|| "original scalar" ,
247
247
self . scalar ,
@@ -254,7 +254,7 @@ impl<C: CurveAffine> Config<C> {
254
254
// If `lsb` is 0, return `Acc + (-P)`. If `lsb` is 1, simply return `Acc + 0`.
255
255
let x_p = if let Some ( lsb) = lsb {
256
256
if !lsb {
257
- base. x . value
257
+ base. x . value ( )
258
258
} else {
259
259
Some ( C :: Base :: zero ( ) )
260
260
}
@@ -263,7 +263,7 @@ impl<C: CurveAffine> Config<C> {
263
263
} ;
264
264
let y_p = if let Some ( lsb) = lsb {
265
265
if !lsb {
266
- base. y . value . map ( |y_p| -y_p)
266
+ base. y . value ( ) . map ( |y_p| -y_p)
267
267
} else {
268
268
Some ( C :: Base :: zero ( ) )
269
269
}
0 commit comments