Skip to content

Commit 1d8af2e

Browse files
committed
no dedicated base64 file needed
1 parent f845ea1 commit 1d8af2e

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

src/lib/proof-system/zkfunction.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { Provable } from '../provable/provable.js';
1212
import { InferProvable, provablePure } from '../provable/types/provable-derivers.js';
1313
import { ProvableTypePure } from '../provable/types/provable-intf.js';
1414
import { Field } from '../provable/wrapped.js';
15-
import { fromBase64, toBase64 } from '../util/base64.js';
1615
import { prettifyStacktrace, prettifyStacktracePromise } from '../util/errors.js';
1716
import { Get, Tuple } from '../util/types.js';
1817
import { TupleToInstances } from './zkprogram.js';
@@ -261,14 +260,14 @@ class KimchiVerificationKey {
261260
const rustVerifierIndex = rustConversion.fp.verifierIndexToRust(this.value as any);
262261
const verifierIndexBase64 =
263262
wasm.caml_pasta_fp_plonk_verifier_index_serialize(rustVerifierIndex);
264-
return toBase64(verifierIndexBase64);
263+
return Buffer.from(verifierIndexBase64, 'utf8').toString('base64');
265264
}
266265

267-
static fromString(s: string): KimchiVerificationKey {
266+
static fromString(base64: string): KimchiVerificationKey {
268267
const srsFp = Pickles.loadSrsFp();
269268
const rustVerifierIndex = wasm.caml_pasta_fp_plonk_verifier_index_deserialize(
270269
srsFp,
271-
fromBase64(s)
270+
Buffer.from(base64, 'base64').toString('utf8')
272271
);
273272
const rustConversion = getRustConversion(wasm);
274273
const verifierIndexMl: unknown = rustConversion.fp.verifierIndexFromRust(rustVerifierIndex);

src/lib/util/base64.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)