Skip to content

Commit

Permalink
allow long lines for hex input
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancdotorg committed Oct 29, 2015
1 parent 781aa05 commit 67efaa4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion brainflayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ static int pass2hash160(unsigned char *pass, size_t pass_sz) {
}

static int hexpass2hash160(unsigned char *hpass, size_t hpass_sz) {
return pass2hash160(unhex(hpass, hpass_sz, unhexed, sizeof(unhexed)), hpass_sz>>1);
if (hpass_sz / 2 > unhexed_sz) {
unhexed_sz = hpass_sz * 3;
unhexed = chkrealloc(unhexed, unhexed_sz);
}
return pass2hash160(unhex(hpass, hpass_sz, unhexed, unhexed_sz), hpass_sz>>1);
}

static int hexpriv2hash160(unsigned char *hpriv, size_t hpriv_sz) {
Expand Down

0 comments on commit 67efaa4

Please sign in to comment.