Commit aabe5168 authored by Annie Ke's avatar Annie Ke Committed by Kelvin Fichter
parent aac58896
...@@ -592,6 +592,7 @@ library Lib_RLPReader { ...@@ -592,6 +592,7 @@ library Lib_RLPReader {
} }
// Pick out the remaining bytes. // Pick out the remaining bytes.
unchecked {
uint256 mask = 256 ** (32 - (_length % 32)) - 1; uint256 mask = 256 ** (32 - (_length % 32)) - 1;
assembly { assembly {
mstore( mstore(
...@@ -605,6 +606,7 @@ library Lib_RLPReader { ...@@ -605,6 +606,7 @@ library Lib_RLPReader {
return out; return out;
} }
}
/** /**
* Copies an RLP item into bytes. * Copies an RLP item into bytes.
......
...@@ -228,6 +228,7 @@ library Lib_RLPWriter { ...@@ -228,6 +228,7 @@ library Lib_RLPWriter {
src += 32; src += 32;
} }
unchecked {
uint256 mask = 256 ** (32 - len) - 1; uint256 mask = 256 ** (32 - len) - 1;
assembly { assembly {
let srcpart := and(mload(src), not(mask)) let srcpart := and(mload(src), not(mask))
...@@ -235,6 +236,7 @@ library Lib_RLPWriter { ...@@ -235,6 +236,7 @@ library Lib_RLPWriter {
mstore(dest, or(destpart, srcpart)) mstore(dest, or(destpart, srcpart))
} }
} }
}
/** /**
* Flattens a list of byte strings into one byte string. * Flattens a list of byte strings into one byte string.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment