gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lsd0003] branch master updated: Fixed some bugs in unpack


From: gnunet
Subject: [lsd0003] branch master updated: Fixed some bugs in unpack
Date: Mon, 14 Jun 2021 15:53:27 +0200

This is an automated email from the git hooks/post-receive script.

elias-summermatter pushed a commit to branch master
in repository lsd0003.

The following commit(s) were added to refs/heads/master by this push:
     new 01f783f  Fixed some bugs in unpack
01f783f is described below

commit 01f783fdf0bc3a93b3f65cab90356ee04600e5c5
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Mon Jun 14 15:50:38 2021 +0200

    Fixed some bugs in unpack
---
 draft-summermatter-set-union.xml | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/draft-summermatter-set-union.xml b/draft-summermatter-set-union.xml
index a728fc9..a482e61 100644
--- a/draft-summermatter-set-union.xml
+++ b/draft-summermatter-set-union.xml
@@ -2311,17 +2311,15 @@ FUNCTION END
 # returns: Nothing because the unpacked counter is saved directly into the IBF
 
 FUNCTION unpack_counter(ibf, offset, count, cbl, pd)
+    ibf_bucket_ctr = 0
     store = 0
     store_bits = 0
     byte_ctr = 0
-    ibf_bucket_ctr = 0
-
-    number_bytes_read = CEILING((count * cbl) / 8)
 
-    WHILE ibf_bucket_ctr <= (count -1)
+    WHILE TRUE
         byte_to_read = pd[byte_ctr]
-        byte_ctr++
         bit_to_pack_left = 8
+        byte_ctr++
 
         WHILE bit_to_pack_left >= 0
 
@@ -2339,7 +2337,7 @@ FUNCTION unpack_counter(ibf, offset, count, cbl, pd)
                 bytes_to_shift = bit_to_pack_left - bit_use
                 counter_partial = byte_to_read >> bytes_to_shift
                 store = store | counter_partial
-                ibf.counter[ibf_bucket_ctr] = store
+                ibf.counter[ibf_bucket_ctr + offset] = store
                 byte_to_read = byte_to_read & (( 1 << bytes_to_shift ) - 1)
 
                 bit_to_pack_left -= bit_use

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]