mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
ReaderImpl now maintains either one or two bytes of lookahead,
depending on the value of the first byte, so that an object's initial tag is included in the data seen by the ObjectReader. Digests and signatures can therefore be calculated over objects by their readers without any risk of ambiguity.
This commit is contained in:
@@ -45,9 +45,7 @@ public class StringUtils {
|
||||
for(int i = 0, j = 0; i < len; i += 2, j++) {
|
||||
int high = hexDigitToInt(hex.charAt(i));
|
||||
int low = hexDigitToInt(hex.charAt(i + 1));
|
||||
int b = (high << 4) + low;
|
||||
if(b > 127) b -= 256;
|
||||
bytes[j] = (byte) b;
|
||||
bytes[j] = (byte) ((high << 4) + low);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user