Skip to content

Commit

Permalink
add vector256 support
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardAH committed Jun 28, 2021
1 parent 93d273a commit 1066d47
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@
var to_accumulate = 0;

var hexaccum = "";
var vec_counter = 0;

var lastnibble = 0;

Expand Down Expand Up @@ -799,7 +800,7 @@
if (to_accumulate == 0)
state = 0;
else
state = 51;
state = (st_type == 19 ? 190 : 51);
continue
} else if (b >= 193 && b <= 240) {
to_accumulate = ((b - 193)*256) + 193
Expand All @@ -825,7 +826,7 @@
print_explain(hexaccum, "2 byte length " + to_accumulate , out)
to_accumulate *= 2
hexaccum = ""
state = 51
state = (st_type == 19 ? 190 : 51)
continue
}

Expand Down Expand Up @@ -856,7 +857,7 @@
print_explain(hexaccum, "3 byte length " + to_accumulate, out)
to_accumulate *= 2
hexaccum = ""
state = 51
state = (st_type == 19 ? 190 : 51)
continue
}

Expand Down Expand Up @@ -1012,7 +1013,7 @@
continue
}
else if (st_type == 19) {
state = 190
state = 70
continue
}
else {
Expand All @@ -1025,7 +1026,39 @@
continue
}

if (state == 190)
{
// vector256
if (to_accumulate == 0)
{
state = 0
continue
}
hex_accum = ""
state = 191
vec_counter = 0
}

if (state == 191)
{
if (to_accumulate % 64 == 0 && hex_accum != "")
{
print_payload("", "", hex_accum, "hash " + (vec_counter++), out);
hex_accum = ""
}
to_accumulate--;
hex_accum += inp[i]
if (to_accumulate <= 0)
{
print_payload("", "", hex_accum, "hash " + (vec_counter++), out);
hex_accum = ""
vec_counter = 0
state = 0
continue
}
console.log(inp[i], to_accumulate)
continue
}

if (state == 182)
{ // pathset accountid or currency or issuer
Expand Down

0 comments on commit 1066d47

Please sign in to comment.