-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New alt_bn128 precompiles for Solana
- Loading branch information
Andrey Trepalin
committed
May 22, 2022
1 parent
3c651eb
commit ee55495
Showing
11 changed files
with
1,150 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#pragma once | ||
/** | ||
* @brief Solana alt_bn128 system calls | ||
*/ | ||
|
||
#include <sol/types.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* Addition on elliptic curves alt_bn128 | ||
* | ||
* @param input ... | ||
* @param input_size ... | ||
* @param result 64 byte array to hold the result. ... | ||
* @return 0 if executed successfully | ||
*/ | ||
uint64_t sol_alt_bn128_addition( | ||
const uint8_t *input, | ||
const unit64_t input_size, | ||
uint8_t *result | ||
); | ||
|
||
/** | ||
* Multiplication on elliptic curves alt_bn128 | ||
* | ||
* @param input ... | ||
* @param input_size ... | ||
* @param result 64 byte array to hold the result. ... | ||
* @return 0 if executed successfully | ||
*/ | ||
uint64_t sol_alt_bn128_multiplication( | ||
const uint8_t *input, | ||
const unit64_t input_size, | ||
uint8_t *result | ||
); | ||
|
||
/** | ||
* Pairing on elliptic curves alt_bn128 | ||
* | ||
* @param input ... | ||
* @param input_size ... | ||
* @param result 64 byte array to hold the result. ... | ||
* @return 0 if executed successfully | ||
*/ | ||
uint64_t sol_alt_bn128_pairing( | ||
const uint8_t *input, | ||
const unit64_t input_size, | ||
uint8_t *result | ||
); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
/**@}*/ |
Oops, something went wrong.