forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 455
/
Copy pathalt_bn128.h
71 lines (59 loc) · 1.59 KB
/
alt_bn128.h
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
62
63
64
65
66
67
68
69
70
71
#pragma once
/**
* @brief Solana bn128 elliptic curve addition, multiplication, and pairing
**/
#include <sol/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Output length for the add operation.
*/
#define ALT_BN128_ADDITION_OUTPUT_LEN 64
/**
* Output length for the multiplication operation.
*/
#define ALT_BN128_MULTIPLICATION_OUTPUT_LEN 64
/**
* Output length for pairing operation.
*/
#define ALT_BN128_PAIRING_OUTPUT_LEN 32
/**
* Add operation.
*/
#define ALT_BN128_ADD 0
/**
* Subtraction operation.
*/
#define ALT_BN128_SUB 1
/**
* Multiplication operation.
*/
#define ALT_BN128_MUL 2
/**
* Pairing operation.
*/
#define ALT_BN128_PAIRING 3
/**
* Addition on elliptic curves alt_bn128
*
* @param group_op ...
* @param input ...
* @param input_size ...
* @param result 64 byte array to hold the result. ...
* @return 0 if executed successfully
*/
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE platform-tools-sdk/sbf/c/inc/sol/inc/alt_bn128.inc AND RUN `cargo run --bin gen-headers` */
#ifndef SOL_SBPFV3
uint64_t sol_alt_bn128_group_op(const uint64_t, const uint8_t *, const uint64_t, uint8_t *);
#else
typedef uint64_t(*sol_alt_bn128_group_op_pointer_type)(const uint64_t, const uint8_t *, const uint64_t, uint8_t *);
static uint64_t sol_alt_bn128_group_op(const uint64_t arg1, const uint8_t * arg2, const uint64_t arg3, uint8_t * arg4) {
sol_alt_bn128_group_op_pointer_type sol_alt_bn128_group_op_pointer = (sol_alt_bn128_group_op_pointer_type) 2920034699;
return sol_alt_bn128_group_op_pointer(arg1, arg2, arg3, arg4);
}
#endif
#ifdef __cplusplus
}
#endif
/**@}*/