You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alt_bn128_add, alt_bn128_mul, alt_bn128_pair, mod_exp, blake2_f, and k1_recover the return values have changed.
Before 0 represented success and 1 represented failure. Now, 0 still represents success but -1 represents failure.
This is done to allow for tri-state return values and specifically for alt_bn128_pair.
The new signature for alt_bn128_pair should be int32_t alt_bn128_pair(const char* bytes, uint32_t length); with the return value capturing whether it was a failure or true/false.
On failure it will return -1, 1 on false and 0 if true and successful.
In addition there are a couple of uses of bool in the new function signatures for blake2_f and sha3. These need to be changed to a fixed size type (preferably int32_t).
Note that since this changes the behavior of the CRYPTO_PRIMITIVES protocol feature without introducing a new protocol feature, the CRYPTO_PRIMITIVES protocol feature of 3.1.0-rc1 should not be used. To reduce confusion among peers who may still use 3.1.0-rc1 in a network with later releases, the feature description of the CRYPTO_PRIMITIVES protocol feature should be changed so that it ends up having a new protocol feature digest.
The text was updated successfully, but these errors were encountered:
For the host functions:
alt_bn128_add
,alt_bn128_mul
,alt_bn128_pair
,mod_exp
,blake2_f
, andk1_recover
the return values have changed.Before 0 represented success and 1 represented failure. Now, 0 still represents success but -1 represents failure.
This is done to allow for tri-state return values and specifically for
alt_bn128_pair
.The new signature for
alt_bn128_pair
should beint32_t alt_bn128_pair(const char* bytes, uint32_t length);
with the return value capturing whether it was a failure or true/false.On failure it will return -1, 1 on false and 0 if true and successful.
In addition there are a couple of uses of
bool
in the new function signatures forblake2_f
andsha3
. These need to be changed to a fixed size type (preferably int32_t).Note that since this changes the behavior of the
CRYPTO_PRIMITIVES
protocol feature without introducing a new protocol feature, theCRYPTO_PRIMITIVES
protocol feature of 3.1.0-rc1 should not be used. To reduce confusion among peers who may still use 3.1.0-rc1 in a network with later releases, the feature description of theCRYPTO_PRIMITIVES
protocol feature should be changed so that it ends up having a new protocol feature digest.The text was updated successfully, but these errors were encountered: