@@ -34,10 +34,10 @@ void init_libff() noexcept {
3434 }();
3535}
3636
37- Scalar to_scalar (const uint8_t * bytes32_be ) noexcept {
37+ Scalar to_scalar (const uint8_t bytes_be[ 32 ] ) noexcept {
3838 mpz_t m;
3939 mpz_init (m);
40- mpz_import (m, 32 , /* order=*/ 1 , /* size=*/ 1 , /* endian=*/ 0 , /* nails=*/ 0 , bytes32_be );
40+ mpz_import (m, 32 , /* order=*/ 1 , /* size=*/ 1 , /* endian=*/ 0 , /* nails=*/ 0 , bytes_be );
4141 Scalar out{m};
4242 mpz_clear (m);
4343 return out;
@@ -49,13 +49,13 @@ static bool valid_element_of_fp(const Scalar& x) noexcept {
4949 return mpn_cmp (x.data , libff::alt_bn128_modulus_q.data , libff::alt_bn128_q_limbs) < 0 ;
5050}
5151
52- std::optional<libff::alt_bn128_G1> decode_g1_element (const uint8_t * bytes64_be ) noexcept {
53- Scalar x{to_scalar (bytes64_be )};
52+ std::optional<libff::alt_bn128_G1> decode_g1_element (const uint8_t bytes_be[ 64 ] ) noexcept {
53+ Scalar x{to_scalar (bytes_be )};
5454 if (!valid_element_of_fp (x)) {
5555 return {};
5656 }
5757
58- Scalar y{to_scalar (bytes64_be + 32 )};
58+ Scalar y{to_scalar (bytes_be + 32 )};
5959 if (!valid_element_of_fp (y)) {
6060 return {};
6161 }
@@ -71,10 +71,10 @@ std::optional<libff::alt_bn128_G1> decode_g1_element(const uint8_t* bytes64_be)
7171 return point;
7272}
7373
74- static std::optional<libff::alt_bn128_Fq2> decode_fp2_element (const uint8_t * bytes64_be ) noexcept {
74+ static std::optional<libff::alt_bn128_Fq2> decode_fp2_element (const uint8_t bytes_be[ 64 ] ) noexcept {
7575 // big-endian encoding
76- Scalar c0{to_scalar (bytes64_be + 32 )};
77- Scalar c1{to_scalar (bytes64_be )};
76+ Scalar c0{to_scalar (bytes_be + 32 )};
77+ Scalar c1{to_scalar (bytes_be )};
7878
7979 if (!valid_element_of_fp (c0) || !valid_element_of_fp (c1)) {
8080 return {};
@@ -83,13 +83,13 @@ static std::optional<libff::alt_bn128_Fq2> decode_fp2_element(const uint8_t* byt
8383 return libff::alt_bn128_Fq2{c0, c1};
8484}
8585
86- std::optional<libff::alt_bn128_G2> decode_g2_element (const uint8_t * bytes128_be ) noexcept {
87- std::optional<libff::alt_bn128_Fq2> x{decode_fp2_element (bytes128_be )};
86+ std::optional<libff::alt_bn128_G2> decode_g2_element (const uint8_t bytes_be[ 128 ] ) noexcept {
87+ std::optional<libff::alt_bn128_Fq2> x{decode_fp2_element (bytes_be )};
8888 if (!x) {
8989 return {};
9090 }
9191
92- std::optional<libff::alt_bn128_Fq2> y{decode_fp2_element (bytes128_be + 64 )};
92+ std::optional<libff::alt_bn128_Fq2> y{decode_fp2_element (bytes_be + 64 )};
9393 if (!y) {
9494 return {};
9595 }
0 commit comments