diff options
author | Florian Dold <florian.dold@gmail.com> | 2014-03-30 21:41:58 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2014-03-30 21:41:58 +0000 |
commit | 9f10abfdc35d8f189a8e0a77a389799ca6b7f9e5 (patch) | |
tree | 39d855abacebeaa45752e4abc5b4a660d2603d70 /src/main/java/org/gnunet/util/BigIntegers.java | |
parent | 1fbef203844b19f8141bddcba20a977de34b211e (diff) | |
download | gnunet-java-9f10abfdc35d8f189a8e0a77a389799ca6b7f9e5.tar.gz gnunet-java-9f10abfdc35d8f189a8e0a77a389799ca6b7f9e5.zip |
- fix election crypto
- multi-way elections
- high-level signature containers
- fix bug in mesh test case
- fix bug in Strings.java
- ivy repo
Diffstat (limited to 'src/main/java/org/gnunet/util/BigIntegers.java')
-rw-r--r-- | src/main/java/org/gnunet/util/BigIntegers.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/gnunet/util/BigIntegers.java b/src/main/java/org/gnunet/util/BigIntegers.java index 473534f..f3f9fa7 100644 --- a/src/main/java/org/gnunet/util/BigIntegers.java +++ b/src/main/java/org/gnunet/util/BigIntegers.java | |||
@@ -31,18 +31,18 @@ public class BigIntegers { | |||
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Serialize a BigInteger, but do not add an extra bit for a | 33 | * Serialize a BigInteger, but do not add an extra bit for a |
34 | * sign. | 34 | * signRaw. |
35 | * | 35 | * |
36 | * @param bigInteger big integer to serialize | 36 | * @param bigInteger big integer to serialize |
37 | * @param bits how many bits should the binary representation have? | 37 | * @param bits how many bits should the binary representation have? |
38 | * rounded up to the next multiple of 8. | 38 | * rounded up to the next multiple of 8. |
39 | * @return big endian representation of the given BigInteger, without a sign bit | 39 | * @return big endian representation of the given BigInteger, without a signRaw bit |
40 | */ | 40 | */ |
41 | public static byte[] serializeUnsigned(BigInteger bigInteger, int bits) { | 41 | public static byte[] serializeUnsigned(BigInteger bigInteger, int bits) { |
42 | byte[] bytes = bigInteger.toByteArray(); | 42 | byte[] bytes = bigInteger.toByteArray(); |
43 | int start; | 43 | int start; |
44 | Preconditions.checkArgument(bigInteger.bitCount() <= bits); | 44 | Preconditions.checkArgument(bigInteger.bitCount() <= bits); |
45 | // skip byte that was only added to fit the sign | 45 | // skip byte that was only added to fit the signRaw |
46 | if (bytes[0] == 0) { | 46 | if (bytes[0] == 0) { |
47 | start = 1; | 47 | start = 1; |
48 | } else { | 48 | } else { |