@@ -108,26 +108,12 @@ export class ConfidentialKeyRotation {
108108 const alpha2 = proofArr [ 3 ] ;
109109 const alpha3 = proofArr [ 4 ] ;
110110 const alpha4 = proofArr [ 5 ] ;
111- const alpha5List = proofArr . slice (
112- 6 ,
113- 6 + ConfidentialAmount . CHUNKS_COUNT ,
114- ) ;
115- const X1 = proofArr [
116- 6 + ConfidentialAmount . CHUNKS_COUNT
117- ] ;
118- const X2 = proofArr [
119- 7 + ConfidentialAmount . CHUNKS_COUNT
120- ] ;
121- const X3 = proofArr [
122- 8 + ConfidentialAmount . CHUNKS_COUNT
123- ] ;
124- const X4List = proofArr . slice (
125- 8 + ConfidentialAmount . CHUNKS_COUNT ,
126- 8 + 2 * ConfidentialAmount . CHUNKS_COUNT ,
127- ) ;
128- const X5List = proofArr . slice (
129- 8 + 2 * ConfidentialAmount . CHUNKS_COUNT ,
130- ) ;
111+ const alpha5List = proofArr . slice ( 6 , 6 + ConfidentialAmount . CHUNKS_COUNT ) ;
112+ const X1 = proofArr [ 6 + ConfidentialAmount . CHUNKS_COUNT ] ;
113+ const X2 = proofArr [ 7 + ConfidentialAmount . CHUNKS_COUNT ] ;
114+ const X3 = proofArr [ 8 + ConfidentialAmount . CHUNKS_COUNT ] ;
115+ const X4List = proofArr . slice ( 8 + ConfidentialAmount . CHUNKS_COUNT , 8 + 2 * ConfidentialAmount . CHUNKS_COUNT ) ;
116+ const X5List = proofArr . slice ( 8 + 2 * ConfidentialAmount . CHUNKS_COUNT ) ;
131117
132118 return {
133119 alpha1List,
@@ -159,11 +145,11 @@ export class ConfidentialKeyRotation {
159145 ed25519modN (
160146 x1List . reduce ( ( acc , el , i ) => {
161147 const coef = 2n ** ( BigInt ( i ) * ConfidentialAmount . CHUNK_BITS_BI ) ;
162- const x1i = el * coef
148+ const x1i = el * coef ;
163149
164150 return acc + x1i ;
165- } , 0n )
166- )
151+ } , 0n ) ,
152+ ) ,
167153 ) . add (
168154 this . currEncryptedBalance
169155 . reduce (
@@ -178,11 +164,11 @@ export class ConfidentialKeyRotation {
178164 const x1iG = RistrettoPoint . BASE . multiply ( el ) ;
179165 const x5iH = H_RISTRETTO . multiply ( x5List [ index ] ) ;
180166
181- return x1iG . add ( x5iH )
167+ return x1iG . add ( x5iH ) ;
182168 } ) ;
183169 const X5List = x5List . map ( ( el ) => {
184- const Pnew = RistrettoPoint . fromHex ( this . newDecryptionKey . publicKey ( ) . toUint8Array ( ) )
185- return Pnew . multiply ( el )
170+ const Pnew = RistrettoPoint . fromHex ( this . newDecryptionKey . publicKey ( ) . toUint8Array ( ) ) ;
171+ return Pnew . multiply ( el ) ;
186172 } ) ;
187173
188174 const p = genFiatShamirChallenge (
@@ -216,7 +202,7 @@ export class ConfidentialKeyRotation {
216202 const alpha5List = x5List . map ( ( el , i ) => {
217203 const pri = ed25519modN ( p * this . randomness [ i ] ) ;
218204
219- return ed25519modN ( el - pri )
205+ return ed25519modN ( el - pri ) ;
220206 } ) ;
221207
222208 return {
@@ -282,10 +268,11 @@ export class ConfidentialKeyRotation {
282268 const a1i = el * coef ;
283269
284270 return acc + a1i ;
285- } , 0n )
286- )
271+ } , 0n ) ,
272+ ) ,
287273 )
288- . add ( DOldSum . multiply ( alpha2LE ) ) . add ( COldSum . multiply ( p ) ) ;
274+ . add ( DOldSum . multiply ( alpha2LE ) )
275+ . add ( COldSum . multiply ( p ) ) ;
289276 const X2 = H_RISTRETTO . multiply ( alpha3LE ) . add ( pkOldRist . multiply ( p ) ) ;
290277 const X3 = H_RISTRETTO . multiply ( alpha4LE ) . add ( pkNewRist . multiply ( p ) ) ;
291278 const X4List = alpha1LEList . map ( ( el , i ) => {
0 commit comments