alt_bn128.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #pragma once
  2. /**
  3. * @brief Solana bn128 elliptic curve addition, multiplication, and pairing
  4. **/
  5. #include <sol/types.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /**
  10. * Output length for the add operation.
  11. */
  12. #define ALT_BN128_ADDITION_OUTPUT_LEN 64
  13. /**
  14. * Output length for the multiplication operation.
  15. */
  16. #define ALT_BN128_MULTIPLICATION_OUTPUT_LEN 64
  17. /**
  18. * Output length for pairing operation.
  19. */
  20. #define ALT_BN128_PAIRING_OUTPUT_LEN 32
  21. /**
  22. * Add operation.
  23. */
  24. #define ALT_BN128_ADD 0
  25. /**
  26. * Subtraction operation.
  27. */
  28. #define ALT_BN128_SUB 1
  29. /**
  30. * Multiplication operation.
  31. */
  32. #define ALT_BN128_MUL 2
  33. /**
  34. * Pairing operation.
  35. */
  36. #define ALT_BN128_PAIRING 3
  37. /**
  38. * Addition on elliptic curves alt_bn128
  39. *
  40. * @param group_op ...
  41. * @param input ...
  42. * @param input_size ...
  43. * @param result 64 byte array to hold the result. ...
  44. * @return 0 if executed successfully
  45. */
  46. /* 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` */
  47. #ifndef SOL_SBFV2
  48. uint64_t sol_alt_bn128_group_op(const uint64_t, const uint8_t *, const uint64_t, uint8_t *);
  49. #else
  50. typedef uint64_t(*sol_alt_bn128_group_op_pointer_type)(const uint64_t, const uint8_t *, const uint64_t, uint8_t *);
  51. static uint64_t sol_alt_bn128_group_op(const uint64_t arg1, const uint8_t * arg2, const uint64_t arg3, uint8_t * arg4) {
  52. sol_alt_bn128_group_op_pointer_type sol_alt_bn128_group_op_pointer = (sol_alt_bn128_group_op_pointer_type) 2920034699;
  53. return sol_alt_bn128_group_op_pointer(arg1, arg2, arg3, arg4);
  54. }
  55. #endif
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. /**@}*/