Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove mode 0, cleanup, cpp11 compatible, 1 opcode per script, change to OP_CHECKZKPVERIFY, optimize bls12-381 #4

Open
wants to merge 9 commits into
base: 1.15.0-dev-groth16
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions qa/rpc-tests/test_framework/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def __new__(cls, n):
OP_NOP1 = CScriptOp(0xb0)
OP_CHECKLOCKTIMEVERIFY = CScriptOp(0xb1)
OP_CHECKSEQUENCEVERIFY = CScriptOp(0xb2)
OP_CHECKGROTH16VERIFY = CScriptOp(0xb3)
OP_CHECKZKPVERIFY = CScriptOp(0xb3)
OP_NOP5 = CScriptOp(0xb4)
OP_NOP6 = CScriptOp(0xb5)
OP_NOP7 = CScriptOp(0xb6)
Expand Down Expand Up @@ -362,7 +362,7 @@ def __new__(cls, n):
OP_NOP1,
OP_CHECKLOCKTIMEVERIFY,
OP_CHECKSEQUENCEVERIFY,
OP_CHECKGROTH16VERIFY,
OP_CHECKZKPVERIFY,
OP_NOP5,
OP_NOP6,
OP_NOP7,
Expand Down Expand Up @@ -481,7 +481,7 @@ def __new__(cls, n):
OP_NOP1 : 'OP_NOP1',
OP_CHECKLOCKTIMEVERIFY : 'OP_CHECKLOCKTIMEVERIFY',
OP_CHECKSEQUENCEVERIFY : 'OP_CHECKSEQUENCEVERIFY',
OP_CHECKGROTH16VERIFY : 'OP_CHECKGROTH16VERIFY',
OP_CHECKZKPVERIFY : 'OP_CHECKZKPVERIFY',
OP_NOP5 : 'OP_NOP5',
OP_NOP6 : 'OP_NOP6',
OP_NOP7 : 'OP_NOP7',
Expand Down Expand Up @@ -600,7 +600,7 @@ def __new__(cls, n):
'OP_NOP1' : OP_NOP1,
'OP_CHECKLOCKTIMEVERIFY' : OP_CHECKLOCKTIMEVERIFY,
'OP_CHECKSEQUENCEVERIFY' : OP_CHECKSEQUENCEVERIFY,
'OP_CHECKGROTH16VERIFY' : OP_CHECKGROTH16VERIFY,
'OP_CHECKZKPVERIFY' : OP_CHECKZKPVERIFY,
'OP_NOP5' : OP_NOP5,
'OP_NOP6' : OP_NOP6,
'OP_NOP7' : OP_NOP7,
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ $(top_srcdir)/$(subdir)/config/bitcoin-config.h.in: $(am__configure_deps)

clean-local:
-$(MAKE) -C secp256k1 clean
-$(MAKE) -C bls clean
-$(MAKE) -C bls12-381 clean
-$(MAKE) -C univalue clean
-rm -f leveldb/*/*.gcda leveldb/*/*.gcno leveldb/helpers/memenv/*.gcda leveldb/helpers/memenv/*.gcno
-rm -f config.h
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.bench.include
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ bench_bench_dogecoin_SOURCES = \
bench/lockedpool.cpp \
bench/perf.cpp \
bench/perf.h \
bench/verify_script.cpp \
bench/scrypt.cpp

# bench_bench_dogecoin_SOURCES_DISABLED = \
Expand Down
38 changes: 38 additions & 0 deletions src/bench/verify_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "script/script.h"
#include "script/sign.h"
#include "streams.h"
#include <core_io.h>

// FIXME: Dedup with BuildCreditingTransaction in test/script_tests.cpp.
static CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey)
Expand Down Expand Up @@ -99,4 +100,41 @@ static void VerifyScriptBench(benchmark::State& state)
}
}

static void VerifyGROTH16ScriptBench(benchmark::State& state)
{
const int flags = SCRIPT_VERIFY_P2SH;

CMutableTransaction txCredit;
DecodeHexTx(txCredit, "0200000001d5258a4fd597edc59d3a9166557c078f05bb992c926d90a0f18c75302d93f99000000000fd0203307f4e6a794e3317a1a2f06a8163ebd70a4a714a5f712d4259a9387d6589615bf63e95bb9233b844f47f5e2a0a312cb300308ddb1235bf6f33189982611ce46edbf62762cf1bda4e245c28c9622452e579078384c4a7c83b00b9b5cb96eaca9abe1130a882ef4edc6a154f1f62d53bf8bf55daeabdf528bbdc9fc7935f37449bafd302aaf19156548ba8b28d29a278ea92f094302882cbef8b8e4f89687f9e8eedc70e8400b0293c05e41c29252683855ecab667100996bda1d61091ccec5c61db9508814c50b9d96fecdd99ff136355dc90772a2ef7788afe1f8a332b34e8a30402477f8e38e874eba3946f6f4ba8c794a09d266507dd66ecb824f911036f2b6bf63ee7a5feb52105bdf466dac06ca427711d5b52c24de90120caec89bedcab3ce707981a6fa86d27b87b2c0a732feee3717aaddd6728877c007c76a82081c202329a17f5756142a72734f6832f7784e22b1e17260901039f504f9098a3884c5090c10d96e70d136fac9a3634428f3792e9b8d02eb903783f71fc8e6937f7f8b1360c8bee9146041a79251614eee9689073af20af273a280e841b078837e65a862279849c1251e1761bb6ac35f2649ea34c50fe63d02ab4af4ab3448fe5e8d4fff135d510a38558c9daee4ae190303c18368ce2ba9fd21e8d1ab0f617a9d249621b56f224b69f6c3a3e008a40b3aea5a5ab77eed73711e93c896023475b27e3a4f6124c50189647ab2c8de2fc37ef189f803704cc55087bfe1c56dcabbb2f343dc145a0470d18317696e1023a7574e8745e0ea301cc6cd679a61133a1c560d5aa3d38d91a999a8f666109495402c553bd7c82056b4c50bf358e5097046487c370c1dd6781dc11d6518717e23b334d4b09892a9763f09059687a7c136f6189568edd6d6f357c1c199a39fa0f723d2218762766f67fa8171b10e8b7e5dd88155651d37ca6b59c754c50092d3dfea8804a69cab1f76133032b85ee7e850977dd1fe578f3d9663bb43a08502a8fd7cb8c7f79c39fbe49f9cee082bf68dfd65e70ccdbfb4c6f834d5dcb3e4619bc44de9ca8aca12b502e74b7b50451b36d6d6d6d6d6d51ffffffff0100113d550200000017a914fda635e6bc2ef7efa82521342c1e3ab932153c628700000000");
CMutableTransaction txSpend;
DecodeHexTx(txSpend, "0200000002952da86dd9c8e4f2587be7adfa9ebe531cc05a8e733f7bd6c02c7ac9f03503b300000000fd020330a1cf4fd86ec455bbe8b983c0dd64abe78ef065724960fecce845873a9df15e10e16c60e948fddd722bd68ed469cca20e30a9cb9215f93c6d926a22367fab2e95d54560a06412ca51304da82d2ee75521a6f58996298c14fe566795d2f654efda0130f23b6a58474bfc3e89499bce8bf7b280b2d84707ffa7f86bc9c94a8174b99f7df7be7e531e8ea759f60abdb4864ad7023016e9e0aa1e58d75831dd90aef95657a5a5e96e9196e6a02f6cb8c6371d311d5654dda6dfd522626f4c90aa0861b067024c50b9d96fecdd99ff136355dc90772a2ef7788afe1f8a332b34e8a30402477f8e38e874eba3946f6f4ba8c794a09d266507dd66ecb824f911036f2b6bf63ee7a5feb52105bdf466dac06ca427711d5b52c24de9012000f3a40258113d7544ec3a1c548047ab9a14e5488320414a311d8de59b7414007c76a82081c202329a17f5756142a72734f6832f7784e22b1e17260901039f504f9098a3884c5090c10d96e70d136fac9a3634428f3792e9b8d02eb903783f71fc8e6937f7f8b1360c8bee9146041a79251614eee9689073af20af273a280e841b078837e65a862279849c1251e1761bb6ac35f2649ea34c50fe63d02ab4af4ab3448fe5e8d4fff135d510a38558c9daee4ae190303c18368ce2ba9fd21e8d1ab0f617a9d249621b56f224b69f6c3a3e008a40b3aea5a5ab77eed73711e93c896023475b27e3a4f6124c50189647ab2c8de2fc37ef189f803704cc55087bfe1c56dcabbb2f343dc145a0470d18317696e1023a7574e8745e0ea301cc6cd679a61133a1c560d5aa3d38d91a999a8f666109495402c553bd7c82056b4c50bf358e5097046487c370c1dd6781dc11d6518717e23b334d4b09892a9763f09059687a7c136f6189568edd6d6f357c1c199a39fa0f723d2218762766f67fa8171b10e8b7e5dd88155651d37ca6b59c754c50092d3dfea8804a69cab1f76133032b85ee7e850977dd1fe578f3d9663bb43a08502a8fd7cb8c7f79c39fbe49f9cee082bf68dfd65e70ccdbfb4c6f834d5dcb3e4619bc44de9ca8aca12b502e74b7b50451b36d6d6d6d6d6d51ffffffffa75fe7d127ffba6a51a6aa750aec49d6861b7e3cc809f259cfcf3d95c71574b900000000fd02033091d0f9aff7bd3da433eb5706a7914bc49d19ea781a9b8eee183929cdfc7a79773a244992d5afd3e9ddc61d70f73b0194300739ce49ac859b19f03d3c0c2bbb7ffb24e64c32e4e632fe74e3a53f5e5aa10ee3551061b3818aa3e126d960cb593f163035c36460f49449043c7892acebd0518122551501a7abd5a00df0962ce1f6977399a5ef4762c0d80ceec2c9833891c617301120658e06a7ede8415aded94c242e8a6d661732a1b8826114814421aff13fec59f847961ae3181b7a533d40f4aa3a924c50b9d96fecdd99ff136355dc90772a2ef7788afe1f8a332b34e8a30402477f8e38e874eba3946f6f4ba8c794a09d266507dd66ecb824f911036f2b6bf63ee7a5feb52105bdf466dac06ca427711d5b52c24de9012000f3a40258113d7544ec3a1c548047ab9a14e5488320414a311d8de59b7414007c76a82081c202329a17f5756142a72734f6832f7784e22b1e17260901039f504f9098a3884c5090c10d96e70d136fac9a3634428f3792e9b8d02eb903783f71fc8e6937f7f8b1360c8bee9146041a79251614eee9689073af20af273a280e841b078837e65a862279849c1251e1761bb6ac35f2649ea34c50fe63d02ab4af4ab3448fe5e8d4fff135d510a38558c9daee4ae190303c18368ce2ba9fd21e8d1ab0f617a9d249621b56f224b69f6c3a3e008a40b3aea5a5ab77eed73711e93c896023475b27e3a4f6124c50189647ab2c8de2fc37ef189f803704cc55087bfe1c56dcabbb2f343dc145a0470d18317696e1023a7574e8745e0ea301cc6cd679a61133a1c560d5aa3d38d91a999a8f666109495402c553bd7c82056b4c50bf358e5097046487c370c1dd6781dc11d6518717e23b334d4b09892a9763f09059687a7c136f6189568edd6d6f357c1c199a39fa0f723d2218762766f67fa8171b10e8b7e5dd88155651d37ca6b59c754c50092d3dfea8804a69cab1f76133032b85ee7e850977dd1fe578f3d9663bb43a08502a8fd7cb8c7f79c39fbe49f9cee082bf68dfd65e70ccdbfb4c6f834d5dcb3e4619bc44de9ca8aca12b502e74b7b50451b36d6d6d6d6d6d51ffffffff01003e6e560200000017a9149faff0ec8c48761a48a8023ed8fd7b8af103c0888700000000");

// Benchmark.
while (state.KeepRunning()) {
ScriptError err;
bool success = VerifyScript(
txSpend.vin[0].scriptSig,
txCredit.vout[0].scriptPubKey,
&txSpend.vin[0].scriptWitness,
flags,
MutableTransactionSignatureChecker(&txSpend, 0, txCredit.vout[0].nValue),
&err);
assert(err == SCRIPT_ERR_OK);
assert(success);

// #if defined(HAVE_CONSENSUS_LIB)
// CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
// stream << txSpend;
// int csuccess = bitcoinconsensus_verify_script_with_amount(
// txCredit.vout[0].scriptPubKey.data(),
// txCredit.vout[0].scriptPubKey.size(),
// txCredit.vout[0].nValue,
// (const unsigned char*)stream.data(), stream.size(), 0, flags, nullptr);
// assert(csuccess == 1);
// #endif
}
}


BENCHMARK(VerifyGROTH16ScriptBench);
BENCHMARK(VerifyScriptBench);
37 changes: 37 additions & 0 deletions src/bls12-381/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Makefile
configure
.libs/
Makefile.in
aclocal.m4
autom4te.cache/
config.log
config.status
conftest*
*.tar.gz
*.la
libtool
.deps/
.dirstamp
*.lo
*.o
*~
*.log


src/bls-config.h
src/libbls-config.h.in
build-aux/ar-lib
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/m4/libtool.m4
build-aux/m4/lt~obsolete.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
build-aux/missing
build-aux/compile
build-aux/test-driver
libbls.pc
10 changes: 3 additions & 7 deletions src/bls12-381/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
ACLOCAL_AMFLAGS = -I build-aux/m4

AM_CXXFLAGS = -std=c++17 -fpic -O2
AM_CPPFLAGS = -std=c++17 -fpic -O2
AM_CXXFLAGS = $(CXXFLAGS)

AM_CFLAGS = --fpic -O2
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libbls.pc

lib_LTLIBRARIES = libbls.la
libbls_la_SOURCES = src/groth16.cpp src/arithmetic.cpp src/fp.cpp src/g.cpp src/pairing.cpp src/scalar.cpp src/utils.cpp

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libbls.pc
64 changes: 29 additions & 35 deletions src/bls12-381/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,55 +13,48 @@ AC_INIT([libbls], m4_join([.], _PKG_VERSION_MAJOR, _PKG_VERSION_MINOR, _PKG_VERS
AC_SUBST(LIB_VERSION_CURRENT, _LIB_VERSION_CURRENT)
AC_SUBST(LIB_VERSION_REVISION, _LIB_VERSION_REVISION)
AC_SUBST(LIB_VERSION_AGE, _LIB_VERSION_AGE)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])
AC_CANONICAL_HOST
AH_TOP([#ifndef LIBMCL_CONFIG_H])
AH_TOP([#define LIBMCL_CONFIG_H])
AH_BOTTOM([#endif /*LIBMCL_CONFIG_H*/])

AM_INIT_AUTOMAKE([1.11.2 foreign subdir-objects])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_ARG_ENABLE([blsasm], [AS_HELP_STRING([--enable-blsasm=yes|no], [Enable blsasm option])], [], [enable_blsasm=no])

AC_PROG_CXX
AC_PROG_CC
AM_PROG_AR

LT_INIT([win32-dll])


CXXFLAGS="-O3 -I include"

AC_CANONICAL_HOST
case "$host_os" in
*mingw64*)
CXXFLAGS="$CXXFLAGS -D__USE_MINGW_ANSI_STDIO=1"
;;
*cygwin*)
;;
*darwin*)
AC_DEFINE([DARWIN], [1], [Define if on Darwin/Mac OS X])
;;
*openbsd*)
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
*freebsd*)
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
*linux*)
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
AC_CANONICAL_TARGET
case $target_cpu in
x86_64*)
AC_MSG_NOTICE(["The target platform is $target_cpu"])
if test "x$enable_blsasm" = "xyes"; then
AC_MSG_NOTICE(["Enable blsasm"])
CXXFLAGS="$CXXFLAGS -D__x86_64_asm__"
else
AC_MSG_NOTICE(["Disable blsasm $host_os"])
case $host_os in
darwin*)
CXXFLAGS="$CXXFLAGS"
;;
*)
CXXFLAGS="$CXXFLAGS -flto"
;;
esac
fi
;;
*)
AC_MSG_NOTICE([The target platform is not x86_64])
CXXFLAGS="$CXXFLAGS -flto"
;;
esac


CXXFLAGS_WARN="-Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wundef"
CXXFLAGS="$CXXFLAGS $CXXFLAGS_WARN -I include -I src"

AC_SUBST(CXXFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(CXX)
AC_SUBST(CC)
AC_SUBST(CXXFLAGS)

AC_CONFIG_FILES([Makefile libbls.pc])

Expand All @@ -76,4 +69,5 @@ echo " CPPFLAGS = $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS"
echo " LDFLAGS = $LDFLAGS"
echo " ENABLE_BLSASM = $enable_blsasm"
echo
29 changes: 15 additions & 14 deletions src/bls12-381/include/bls12-381/arithmetic.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include <cstdint>
#include <tuple>

#if defined(UINT128_MAX) || defined(__SIZEOF_INT128__)
#define USE_INT128
typedef __int128 int128_t;
typedef unsigned __int128 uint128_t;
#endif

namespace bls12_381
{
Expand All @@ -27,9 +30,7 @@ void _lsubtract(fp* z, const fp* x, const fp* y);
// The "smaller than 4p" here means the montgomery form itself as number is less than 4p.
// Therefore, at most ONE _ladd/_lsubstract/_ldouble is allowed before passing the result to _multiply,
// unless the algorithm makes sure the number is small.
#if defined(__x86_64__) && defined(__ELF__)
extern void _multiply(fp*, const fp*, const fp*);
#elif defined(__x86_64__)
#if defined(__x86_64_asm__)
extern void (*_multiply)(fp*, const fp*, const fp*);
#else
void _multiply(fp*, const fp*, const fp*);
Expand All @@ -40,7 +41,7 @@ void _multiply(fp*, const fp*, const fp*);
// The carryOut output is guaranteed to be 0 or 1.
//
// This function's execution time does not depend on the inputs.
std::tuple<uint64_t, uint64_t> Add64(
inline std::tuple<uint64_t, uint64_t> Add64(
const uint64_t& x,
const uint64_t& y,
const uint64_t& carry
Expand All @@ -62,12 +63,12 @@ std::tuple<uint64_t, uint64_t> Sub64(
// half returned in lo.
//
// This function's execution time does not depend on the inputs.
std::tuple<uint64_t, uint64_t> Mul64(
inline std::tuple<uint64_t, uint64_t> Mul64(
const uint64_t& x,
const uint64_t& y
);

std::tuple<uint64_t, uint64_t, uint64_t> madd(
inline std::tuple<uint64_t, uint64_t, uint64_t> madd(
const uint64_t& a,
const uint64_t& b,
const uint64_t& t,
Expand All @@ -76,57 +77,57 @@ std::tuple<uint64_t, uint64_t, uint64_t> madd(
);

// madd0 hi = a*b + c (discards lo bits)
uint64_t madd0(
inline uint64_t madd0(
const uint64_t& a,
const uint64_t& b,
const uint64_t& c
);

// madd1 hi, lo = a*b + c
std::tuple<uint64_t, uint64_t> madd1(
inline std::tuple<uint64_t, uint64_t> madd1(
const uint64_t& a,
const uint64_t& b,
const uint64_t& c
);

// madd2 hi, lo = a*b + c + d
std::tuple<uint64_t, uint64_t> madd2(
inline std::tuple<uint64_t, uint64_t> madd2(
const uint64_t& a,
const uint64_t& b,
const uint64_t& c,
const uint64_t& d
);

// madd2s superhi, hi, lo = 2*a*b + c + d + e
std::tuple<uint64_t, uint64_t, uint64_t> madd2s(
inline std::tuple<uint64_t, uint64_t, uint64_t> madd2s(
const uint64_t& a,
const uint64_t& b,
const uint64_t& c,
const uint64_t& d,
const uint64_t& e
);

std::tuple<uint64_t, uint64_t, uint64_t> madd1s(
inline std::tuple<uint64_t, uint64_t, uint64_t> madd1s(
const uint64_t& a,
const uint64_t& b,
const uint64_t& d,
const uint64_t& e
);

std::tuple<uint64_t, uint64_t, uint64_t> madd2sb(
inline std::tuple<uint64_t, uint64_t, uint64_t> madd2sb(
const uint64_t& a,
const uint64_t& b,
const uint64_t& c,
const uint64_t& e
);

std::tuple<uint64_t, uint64_t, uint64_t> madd1sb(
inline std::tuple<uint64_t, uint64_t, uint64_t> madd1sb(
const uint64_t& a,
const uint64_t& b,
const uint64_t& e
);

std::tuple<uint64_t, uint64_t> madd3(
inline std::tuple<uint64_t, uint64_t> madd3(
const uint64_t& a,
const uint64_t& b,
const uint64_t& c,
Expand Down
4 changes: 0 additions & 4 deletions src/bls12-381/include/bls12-381/g.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ class g1
void toAffineBytesBE(const tcb::span<uint8_t, 96> out, const from_mont fm = from_mont::yes) const;
void toAffineBytesLE(const tcb::span<uint8_t, 96> out, const from_mont fm = from_mont::yes) const;
void toCompressedBytesBE(const tcb::span<uint8_t, 48> out) const;
void toCompressedMCLBytesLE(const tcb::span<uint8_t, 48> out) const;
std::array<uint8_t, 144> toJacobianBytesBE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 144> toJacobianBytesLE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 96> toAffineBytesBE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 96> toAffineBytesLE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 48> toCompressedBytesBE() const;
std::array<uint8_t, 48> toCompressedMCLBytesLE() const;
static g1 zero();
static g1 one();
bool isZero() const;
Expand Down Expand Up @@ -134,13 +132,11 @@ class g2
void toAffineBytesBE(const tcb::span<uint8_t, 192> out, const from_mont fm = from_mont::yes) const;
void toAffineBytesLE(const tcb::span<uint8_t, 192> out, const from_mont fm = from_mont::yes) const;
void toCompressedBytesBE(const tcb::span<uint8_t, 96> out) const;
void toCompressedMCLBytesLE(const tcb::span<uint8_t, 96> out) const;
std::array<uint8_t, 288> toJacobianBytesBE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 288> toJacobianBytesLE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 192> toAffineBytesBE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 192> toAffineBytesLE(const from_mont fm = from_mont::yes) const;
std::array<uint8_t, 96> toCompressedBytesBE() const;
std::array<uint8_t, 96> toCompressedMCLBytesLE() const;
static g2 zero();
static g2 one();
bool isZero() const;
Expand Down
Loading