-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflutter_rapidsnark_platform_interface.dart
61 lines (49 loc) · 1.69 KB
/
flutter_rapidsnark_platform_interface.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import 'dart:typed_data';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'flutter_rapidsnark_method_channel.dart';
import 'model.dart';
abstract class FlutterRapidsnarkPlatform extends PlatformInterface {
/// Constructs a FlutterRapidsnarkPlatform.
FlutterRapidsnarkPlatform() : super(token: _token);
static final Object _token = Object();
static FlutterRapidsnarkPlatform _instance = MethodChannelFlutterRapidsnark();
/// The default instance of [FlutterRapidsnarkPlatform] to use.
///
/// Defaults to [MethodChannelFlutterRapidsnark].
static FlutterRapidsnarkPlatform get instance => _instance;
/// Platform-specific implementations should set this with their own
/// platform-specific class that extends [FlutterRapidsnarkPlatform] when
/// they register themselves.
static set instance(FlutterRapidsnarkPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
Future<ProveResult> groth16Prove({
required Uint8List zkey,
required Uint8List witness,
int proofBufferSize,
int? publicBufferSize,
int errorBufferSize,
});
Future<ProveResult> groth16ProveWithZKeyFilePath({
required String zkeyPath,
required Uint8List witness,
int proofBufferSize,
int? publicBufferSize,
int errorBufferSize,
});
Future<bool> groth16Verify({
required String proof,
required String inputs,
required String verificationKey,
int errorBufferSize,
});
Future<int> groth16PublicSizeForZkeyBuf({
required Uint8List zkey,
int errorBufferSize,
});
Future<int> groth16PublicSizeForZkeyFile({
required String zkeyPath,
int errorBufferSize,
});
}