Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
XuJiandong committed Jan 15, 2024
1 parent 261283c commit 4c2561e
Show file tree
Hide file tree
Showing 5 changed files with 342 additions and 113 deletions.
8 changes: 8 additions & 0 deletions c/ckb_identity.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ typedef int (*validate_signature_t)(void *prefilled_data, const uint8_t *sig,
typedef int (*convert_msg_t)(const uint8_t *msg, size_t msg_len,
uint8_t *new_msg, size_t new_msg_len);

bool g_cobuild_enabled = false;
uint8_t g_cobuild_signing_message_hash[32];

static void bin_to_hex(const uint8_t *source, uint8_t *dest, size_t len) {
const static uint8_t HEX_TABLE[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
Expand Down Expand Up @@ -375,6 +378,11 @@ int validate_signature_eos(void *prefilled_data, const uint8_t *sig,
}

int generate_sighash_all(uint8_t *msg, size_t msg_len) {
if (g_cobuild_enabled) {
memcpy(msg, g_cobuild_signing_message_hash, BLAKE2B_BLOCK_SIZE);
return 0;
}

int ret;
uint64_t len = 0;
unsigned char temp[MAX_WITNESS_SIZE];
Expand Down
Loading

0 comments on commit 4c2561e

Please sign in to comment.