@@ -29,8 +29,8 @@ import {
2929 universalAccumulatorRemoveBatch ,
3030 universalAccumulatorVerifyMembership ,
3131 universalAccumulatorVerifyNonMembership
32- } from '@docknetwork/ crypto-wasm' ;
33- import { MembershipWitness , NonMembershipWitness } from './accumulatorWitness' ;
32+ } from 'crypto-wasm-new ' ;
33+ import { VBMembershipWitness , VBNonMembershipWitness } from './accumulatorWitness' ;
3434import { getUint8ArraysFromObject } from '../util' ;
3535import { IAccumulatorState , IUniversalAccumulatorState } from './IAccumulatorState' ;
3636import { IInitialElementsStore } from './IInitialElementsStore' ;
@@ -261,7 +261,7 @@ export abstract class Accumulator {
261261 element : Uint8Array ,
262262 secretKey ?: AccumulatorSecretKey ,
263263 state ?: IAccumulatorState
264- ) : Promise < MembershipWitness > ;
264+ ) : Promise < VBMembershipWitness > ;
265265
266266 /**
267267 * Calculate the membership witnesses for the given batch of elements
@@ -273,7 +273,7 @@ export abstract class Accumulator {
273273 elements : Uint8Array [ ] ,
274274 secretKey ?: AccumulatorSecretKey ,
275275 state ?: IAccumulatorState
276- ) : Promise < MembershipWitness [ ] > ;
276+ ) : Promise < VBMembershipWitness [ ] > ;
277277
278278 /**
279279 * Verify the membership witness.
@@ -284,7 +284,7 @@ export abstract class Accumulator {
284284 */
285285 abstract verifyMembershipWitness (
286286 member : Uint8Array ,
287- witness : MembershipWitness ,
287+ witness : VBMembershipWitness ,
288288 pk : AccumulatorPublicKey ,
289289 params ?: AccumulatorParams
290290 ) : boolean ;
@@ -508,11 +508,11 @@ export class PositiveAccumulator extends Accumulator {
508508 member : Uint8Array ,
509509 secretKey ?: AccumulatorSecretKey ,
510510 state ?: IAccumulatorState
511- ) : Promise < MembershipWitness > {
511+ ) : Promise < VBMembershipWitness > {
512512 await this . ensurePresence ( member , state ) ;
513513 const sk = this . getSecretKey ( secretKey ) ;
514514 const wit = positiveAccumulatorMembershipWitness ( this . value , member , sk . value ) ;
515- return new MembershipWitness ( wit ) ;
515+ return new VBMembershipWitness ( wit ) ;
516516 }
517517
518518 /**
@@ -526,11 +526,11 @@ export class PositiveAccumulator extends Accumulator {
526526 members : Uint8Array [ ] ,
527527 secretKey ?: AccumulatorSecretKey ,
528528 state ?: IAccumulatorState
529- ) : Promise < MembershipWitness [ ] > {
529+ ) : Promise < VBMembershipWitness [ ] > {
530530 await this . ensurePresenceOfBatch ( members , state ) ;
531531 const sk = this . getSecretKey ( secretKey ) ;
532532 return positiveAccumulatorMembershipWitnessesForBatch ( this . value , members , sk . value ) . map (
533- ( m ) => new MembershipWitness ( m )
533+ ( m ) => new VBMembershipWitness ( m )
534534 ) ;
535535 }
536536
@@ -544,7 +544,7 @@ export class PositiveAccumulator extends Accumulator {
544544 */
545545 verifyMembershipWitness (
546546 member : Uint8Array ,
547- witness : MembershipWitness ,
547+ witness : VBMembershipWitness ,
548548 publicKey : AccumulatorPublicKey ,
549549 params ?: AccumulatorParams
550550 ) : boolean {
@@ -750,25 +750,25 @@ export class UniversalAccumulator extends Accumulator {
750750 secretKey ?: AccumulatorSecretKey ,
751751 state ?: IAccumulatorState ,
752752 initialElementsStore ?: IInitialElementsStore
753- ) : Promise < MembershipWitness > {
753+ ) : Promise < VBMembershipWitness > {
754754 await this . checkElementAcceptable ( member , initialElementsStore ) ;
755755 await this . ensurePresence ( member , state ) ;
756756 const sk = this . getSecretKey ( secretKey ) ;
757757 const wit = universalAccumulatorMembershipWitness ( this . value , member , sk . value ) ;
758- return new MembershipWitness ( wit ) ;
758+ return new VBMembershipWitness ( wit ) ;
759759 }
760760
761761 async membershipWitnessesForBatch (
762762 members : Uint8Array [ ] ,
763763 secretKey ?: AccumulatorSecretKey ,
764764 state ?: IAccumulatorState ,
765765 initialElementsStore ?: IInitialElementsStore
766- ) : Promise < MembershipWitness [ ] > {
766+ ) : Promise < VBMembershipWitness [ ] > {
767767 await this . checkElementBatchAcceptable ( members , initialElementsStore ) ;
768768 await this . ensurePresenceOfBatch ( members , state ) ;
769769 const sk = this . getSecretKey ( secretKey ) ;
770770 return universalAccumulatorMembershipWitnessesForBatch ( this . value , members , sk . value ) . map (
771- ( m ) => new MembershipWitness ( m )
771+ ( m ) => new VBMembershipWitness ( m )
772772 ) ;
773773 }
774774
@@ -790,7 +790,7 @@ export class UniversalAccumulator extends Accumulator {
790790 params ?: AccumulatorParams ,
791791 initialElementsStore ?: IInitialElementsStore ,
792792 batchSize = 100
793- ) : Promise < NonMembershipWitness > {
793+ ) : Promise < VBNonMembershipWitness > {
794794 await this . checkElementAcceptable ( nonMember , initialElementsStore ) ;
795795 await this . ensureAbsence ( nonMember , state ) ;
796796 const sk = this . getSecretKey ( secretKey ) ;
@@ -810,7 +810,7 @@ export class UniversalAccumulator extends Accumulator {
810810 }
811811 const d = universalAccumulatorCombineMultipleD ( ds ) ;
812812 const wit = universalAccumulatorNonMembershipWitness ( this . value , d , nonMember , sk . value , params_ . value ) ;
813- return new NonMembershipWitness ( wit ) ;
813+ return new VBNonMembershipWitness ( wit ) ;
814814 }
815815
816816 /**
@@ -830,13 +830,13 @@ export class UniversalAccumulator extends Accumulator {
830830 params ?: AccumulatorParams ,
831831 state ?: IUniversalAccumulatorState ,
832832 initialElementsStore ?: IInitialElementsStore
833- ) : Promise < NonMembershipWitness > {
833+ ) : Promise < VBNonMembershipWitness > {
834834 await this . checkElementAcceptable ( nonMember , initialElementsStore ) ;
835835 await this . ensureAbsence ( nonMember , state ) ;
836836 const sk = this . getSecretKey ( secretKey ) ;
837837 const params_ = this . getParams ( params ) ;
838838 const wit = universalAccumulatorNonMembershipWitness ( this . value , d , nonMember , sk . value , params_ . value ) ;
839- return new NonMembershipWitness ( wit ) ;
839+ return new VBNonMembershipWitness ( wit ) ;
840840 }
841841
842842 /**
@@ -856,7 +856,7 @@ export class UniversalAccumulator extends Accumulator {
856856 params ?: AccumulatorParams ,
857857 initialElementsStore ?: IInitialElementsStore ,
858858 batchSize = 100
859- ) : Promise < NonMembershipWitness [ ] > {
859+ ) : Promise < VBNonMembershipWitness [ ] > {
860860 await this . checkElementBatchAcceptable ( nonMembers , initialElementsStore ) ;
861861 await this . ensureAbsenceOfBatch ( nonMembers , state ) ;
862862 const sk = this . getSecretKey ( secretKey ) ;
@@ -894,7 +894,7 @@ export class UniversalAccumulator extends Accumulator {
894894 ds [ i ] = universalAccumulatorCombineMultipleD ( dsForAll [ i ] ) ;
895895 }
896896 return universalAccumulatorNonMembershipWitnessesForBatch ( this . value , ds , nonMembers , sk . value , params_ . value ) . map (
897- ( m ) => new NonMembershipWitness ( m )
897+ ( m ) => new VBNonMembershipWitness ( m )
898898 ) ;
899899 }
900900
@@ -915,19 +915,19 @@ export class UniversalAccumulator extends Accumulator {
915915 params ?: AccumulatorParams ,
916916 state ?: IUniversalAccumulatorState ,
917917 initialElementsStore ?: IInitialElementsStore
918- ) : Promise < NonMembershipWitness [ ] > {
918+ ) : Promise < VBNonMembershipWitness [ ] > {
919919 await this . checkElementBatchAcceptable ( nonMembers , initialElementsStore ) ;
920920 await this . ensureAbsenceOfBatch ( nonMembers , state ) ;
921921 const sk = this . getSecretKey ( secretKey ) ;
922922 const params_ = this . getParams ( params ) ;
923923 return universalAccumulatorNonMembershipWitnessesForBatch ( this . value , d , nonMembers , sk . value , params_ . value ) . map (
924- ( m ) => new NonMembershipWitness ( m )
924+ ( m ) => new VBNonMembershipWitness ( m )
925925 ) ;
926926 }
927927
928928 verifyMembershipWitness (
929929 member : Uint8Array ,
930- witness : MembershipWitness ,
930+ witness : VBMembershipWitness ,
931931 pk : AccumulatorPublicKey ,
932932 params ?: AccumulatorParams
933933 ) : boolean {
@@ -937,7 +937,7 @@ export class UniversalAccumulator extends Accumulator {
937937
938938 verifyNonMembershipWitness (
939939 nonMember : Uint8Array ,
940- witness : NonMembershipWitness ,
940+ witness : VBNonMembershipWitness ,
941941 pk : AccumulatorPublicKey ,
942942 params ?: AccumulatorParams
943943 ) : boolean {
0 commit comments