@@ -6,21 +6,21 @@ use crate::program_error::ProgramError;
66#[ cfg( target_os = "solana" ) ]
77use crate :: syscalls:: sol_alt_bn128_group_op;
88
9- /// Input length for the add operation.
10- pub const ALT_BN128_ADDITION_INPUT_LEN : usize = ALT_BN128_G1_POINT_SIZE * 2 ; // 128
9+ /// Input size for the add operation.
10+ pub const ALT_BN128_ADDITION_INPUT_SIZE : usize = ALT_BN128_G1_POINT_SIZE * 2 ; // 128
1111
12- /// Input length for the multiplication operation.
13- pub const ALT_BN128_MULTIPLICATION_INPUT_LEN : usize =
12+ /// Input size for the multiplication operation.
13+ pub const ALT_BN128_MULTIPLICATION_INPUT_SIZE : usize =
1414 ALT_BN128_G1_POINT_SIZE + ALT_BN128_FIELD_SIZE ; // 96
1515
16- /// Pair element length .
17- pub const ALT_BN128_PAIRING_ELEMENT_LEN : usize = ALT_BN128_G1_POINT_SIZE + ALT_BN128_G2_POINT_SIZE ; // 192
16+ /// Pair element size .
17+ pub const ALT_BN128_PAIRING_ELEMENT_SIZE : usize = ALT_BN128_G1_POINT_SIZE + ALT_BN128_G2_POINT_SIZE ; // 192
1818
19- /// Output length for the add operation.
20- pub const ALT_BN128_ADDITION_OUTPUT_LEN : usize = ALT_BN128_G1_POINT_SIZE ; // 64
19+ /// Output size for the add operation.
20+ pub const ALT_BN128_ADDITION_OUTPUT_SIZE : usize = ALT_BN128_G1_POINT_SIZE ; // 64
2121
22- /// Output length for the multiplication operation.
23- pub const ALT_BN128_MULTIPLICATION_OUTPUT_LEN : usize = ALT_BN128_G1_POINT_SIZE ; // 64
22+ /// Output size for the multiplication operation.
23+ pub const ALT_BN128_MULTIPLICATION_OUTPUT_SIZE : usize = ALT_BN128_G1_POINT_SIZE ; // 64
2424
2525const ALT_BN128_G1_ADD_BE : u64 = 0 ;
2626#[ allow( dead_code) ]
@@ -44,7 +44,7 @@ const ALT_BN128_PAIRING_BE: u64 = 3;
4444#[ inline( always) ]
4545pub fn alt_bn128_g1_addition_be (
4646 input : & [ u8 ] ,
47- ) -> Result < [ u8 ; ALT_BN128_ADDITION_OUTPUT_LEN ] , ProgramError > {
47+ ) -> Result < [ u8 ; ALT_BN128_ADDITION_OUTPUT_SIZE ] , ProgramError > {
4848 alt_bn128_group_op ( input, ALT_BN128_G1_ADD_BE )
4949}
5050
@@ -65,7 +65,7 @@ pub fn alt_bn128_g1_addition_be(
6565#[ inline( always) ]
6666pub fn alt_bn128_g1_multiplication_be (
6767 input : & [ u8 ] ,
68- ) -> Result < [ u8 ; ALT_BN128_MULTIPLICATION_OUTPUT_LEN ] , ProgramError > {
68+ ) -> Result < [ u8 ; ALT_BN128_MULTIPLICATION_OUTPUT_SIZE ] , ProgramError > {
6969 alt_bn128_group_op ( input, ALT_BN128_G1_MUL_BE )
7070}
7171
@@ -81,7 +81,7 @@ pub fn alt_bn128_g1_multiplication_be(
8181///
8282/// Note: This function does **not** check if the input has the correct length.
8383/// Currently, if the length is invalid, it will not return an error; instead it will use only
84- /// multiples of [`ALT_BN128_PAIRING_ELEMENT_LEN `] bytes and discard the rest.
84+ /// multiples of [`ALT_BN128_PAIRING_ELEMENT_SIZE `] bytes and discard the rest.
8585/// After SIMD-0334 is implemented, it will return an error if the length is invalid,
8686/// incurring the cost of the syscall.
8787#[ inline( always) ]
@@ -90,14 +90,14 @@ pub fn alt_bn128_pairing_be(input: &[u8]) -> Result<u8, ProgramError> {
9090}
9191
9292#[ inline]
93- fn alt_bn128_group_op < const OUTPUT_DATA_LEN : usize > (
93+ fn alt_bn128_group_op < const OUTPUT_DATA_SIZE : usize > (
9494 input : & [ u8 ] ,
9595 op : u64 ,
96- ) -> Result < [ u8 ; OUTPUT_DATA_LEN ] , ProgramError > {
96+ ) -> Result < [ u8 ; OUTPUT_DATA_SIZE ] , ProgramError > {
9797 // Call via a system call to perform the calculation
9898 #[ cfg( target_os = "solana" ) ]
9999 {
100- let mut bytes = core:: mem:: MaybeUninit :: < [ u8 ; OUTPUT_DATA_LEN ] > :: uninit ( ) ;
100+ let mut bytes = core:: mem:: MaybeUninit :: < [ u8 ; OUTPUT_DATA_SIZE ] > :: uninit ( ) ;
101101
102102 let result = unsafe {
103103 sol_alt_bn128_group_op (
0 commit comments