@@ -1825,6 +1825,7 @@ class ZqField$1 {
18251825 buildSqrt ( this ) ;
18261826
18271827 this . FFT = new FFT ( this , this , this . mul . bind ( this ) ) ;
1828+ this . shift = this . square ( this . nqr ) ;
18281829 }
18291830
18301831 e ( a , b ) {
@@ -2057,8 +2058,9 @@ class ZqField$1 {
20572058 }
20582059
20592060 toString ( a , base ) {
2061+ base = base || 10 ;
20602062 let vs ;
2061- if ( a > this . half ) {
2063+ if ( ( a > this . half ) && ( base == 10 ) ) {
20622064 const v = this . p - a ;
20632065 vs = "-" + v . toString ( base ) ;
20642066 } else {
@@ -2134,6 +2136,8 @@ class ZqField {
21342136 buildSqrt ( this ) ;
21352137
21362138 this . FFT = new FFFT ( this , this , this . mul . bind ( this ) ) ;
2139+
2140+ this . shift = this . square ( this . nqr ) ;
21372141 }
21382142
21392143 e ( a , b ) {
@@ -2348,8 +2352,9 @@ class ZqField {
23482352 }
23492353
23502354 toString ( a , base ) {
2355+ base = base || 10 ;
23512356 let vs ;
2352- if ( ! a . lesserOrEquals ( this . p . shiftRight ( bigInt__default [ "default" ] ( 1 ) ) ) ) {
2357+ if ( ( ! a . lesserOrEquals ( this . p . shiftRight ( bigInt__default [ "default" ] ( 1 ) ) ) ) && ( base == 10 ) ) {
23532358 const v = this . p . minus ( a ) ;
23542359 vs = "-" + v . toString ( base ) ;
23552360 } else {
@@ -2434,6 +2439,10 @@ class F1Field extends _F1Field {
24342439 return this . mul ( this . fromRprBE ( buff , o ) , this . Ri ) ;
24352440 }
24362441
2442+ toObject ( a ) {
2443+ return a ;
2444+ }
2445+
24372446}
24382447
24392448/*
@@ -2667,6 +2676,10 @@ class F2Field {
26672676 return [ c0 , c1 ] ;
26682677 }
26692678
2679+ toObject ( a ) {
2680+ return a ;
2681+ }
2682+
26702683}
26712684
26722685/*
@@ -2947,6 +2960,9 @@ class F3Field {
29472960 return [ c0 , c1 , c2 ] ;
29482961 }
29492962
2963+ toObject ( a ) {
2964+ return a ;
2965+ }
29502966}
29512967
29522968/*
0 commit comments