github.com/ethereum/go-ethereum@v1.16.1/crypto/secp256k1/libsecp256k1/src/modules/musig/keyagg.h (about) 1 /*********************************************************************** 2 * Distributed under the MIT software license, see the accompanying * 3 * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 4 ***********************************************************************/ 5 6 #ifndef SECP256K1_MODULE_MUSIG_KEYAGG_H 7 #define SECP256K1_MODULE_MUSIG_KEYAGG_H 8 9 #include "../../../include/secp256k1.h" 10 #include "../../../include/secp256k1_musig.h" 11 12 #include "../../group.h" 13 #include "../../scalar.h" 14 15 typedef struct { 16 secp256k1_ge pk; 17 /* If there is no "second" public key, second_pk is set to the point at 18 * infinity */ 19 secp256k1_ge second_pk; 20 unsigned char pks_hash[32]; 21 /* tweak is identical to value tacc[v] in the specification. */ 22 secp256k1_scalar tweak; 23 /* parity_acc corresponds to (1 - gacc[v])/2 in the spec. So if gacc[v] is 24 * -1, parity_acc is 1. Otherwise, parity_acc is 0. */ 25 int parity_acc; 26 } secp256k1_keyagg_cache_internal; 27 28 static int secp256k1_keyagg_cache_load(const secp256k1_context* ctx, secp256k1_keyagg_cache_internal *cache_i, const secp256k1_musig_keyagg_cache *cache); 29 30 static void secp256k1_musig_keyaggcoef(secp256k1_scalar *r, const secp256k1_keyagg_cache_internal *cache_i, secp256k1_ge *pk); 31 32 #endif