MCPcopy Create free account
hub / github.com/ElementsProject/lightning / payer_key_tweak

Function payer_key_tweak

hsmd/libhsmd.c:821–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819}
820
821static void payer_key_tweak(const struct pubkey *bolt12,
822 const u8 *publictweak, size_t publictweaklen,
823 struct sha256 *tweak)
824{
825 u8 rawkey[PUBKEY_CMPR_LEN];
826 struct sha256_ctx sha;
827
828 pubkey_to_der(rawkey, bolt12);
829
830 sha256_init(&sha);
831 sha256_update(&sha, rawkey, sizeof(rawkey));
832 sha256_update(&sha, publictweak, publictweaklen);
833 sha256_done(&sha, tweak);
834}
835
836/*~ lightningd asks us to sign a bolt12 (e.g. offer). */
837static u8 *handle_sign_bolt12(struct hsmd_client *c, const u8 *msg_in)

Callers 1

handle_sign_bolt12Function · 0.85

Calls 4

pubkey_to_derFunction · 0.85
sha256_initFunction · 0.85
sha256_updateFunction · 0.85
sha256_doneFunction · 0.85

Tested by

no test coverage detected