aboutsummaryrefslogtreecommitdiff
path: root/draft-summermatter-set-union.xml
diff options
context:
space:
mode:
Diffstat (limited to 'draft-summermatter-set-union.xml')
-rw-r--r--draft-summermatter-set-union.xml58
1 files changed, 25 insertions, 33 deletions
diff --git a/draft-summermatter-set-union.xml b/draft-summermatter-set-union.xml
index 1a82d3d..a344788 100644
--- a/draft-summermatter-set-union.xml
+++ b/draft-summermatter-set-union.xml
@@ -2259,35 +2259,24 @@ FUNCTION pack_counter(ibf, offset, count)
2259 counter = bucket.counter 2259 counter = bucket.counter
2260 byte_len = counter_bytes 2260 byte_len = counter_bytes
2261 2261
2262 WHILE TRUE 2262 WHILE byte_len + store_bits < 8
2263 byte_to_write = 0 2263 bit_to_shift = 0
2264 2264
2265 IF byte_len + store_bits >= 8 2265 IF store_bits > 0 OR byte_len > 8
2266 bit_to_shift = 0 2266 bit_free = 8 - store_bits
2267 2267 bit_to_shift = byte_len - bit_free
2268 IF store_bits > 0 OR byte_len > 8 2268 store = store << bit_free
2269 bit_free = 8 - store_bits
2270 bit_to_shift = byte_len - bit_free
2271 store = store << bit_free
2272 END IF
2273 byte_to_write = (( counter >> bit_to_shift) | store) & 0xFF
2274 byte_len -= 8 - store_bits
2275 counter = counter & ((1 << byte_len) - 1)
2276 store = 0
2277 store_bits = 0
2278 ELSE
2279 IF 0 == store_bits
2280 store = counter
2281 ELSE
2282 store = (store << byte_len) | counter
2283 END IF
2284 store_bits = store_bits + byte_len
2285 byte_len = 0
2286 BREAK
2287 END IF 2269 END IF
2288 buffer[byte_ctr] = byte_to_write 2270 buffer[byte_ctr] = (( counter >> bit_to_shift) | store) & 0xFF
2289 byte_ctr = byte_ctr + 1 2271 byte_ctr = byte_ctr + 1
2272 byte_len -= 8 - store_bits
2273 counter = counter & ((1 << byte_len) - 1)
2274 store = 0
2275 store_bits = 0
2290 END WHILE 2276 END WHILE
2277 store = (store << byte_len) | counter
2278 store_bits = store_bits + byte_len
2279 byte_len = 0
2291 END FOR 2280 END FOR
2292 2281
2293 # Write the last partial packed byte to the buffer 2282 # Write the last partial packed byte to the buffer
@@ -2353,10 +2342,12 @@ FUNCTION unpack_counter(ibf, offset, count, cbl, pd)
2353 ELSE 2342 ELSE
2354 store = store << bit_to_pack_left 2343 store = store << bit_to_pack_left
2355 store = store | byte_to_read 2344 store = store | byte_to_read
2345 END IF
2356 BREAK 2346 BREAK
2357 END IF 2347 END IF
2358 END WHILE 2348 END WHILE
2359 END WHILE 2349 END WHILE
2350END FUNCTION
2360 ]]></artwork> 2351 ]]></artwork>
2361 </figure> 2352 </figure>
2362 </section> 2353 </section>
@@ -2398,8 +2389,9 @@ FUNCTION unpack_counter(ibf, offset, count, cbl, pd)
2398# Returns: Salted value 2389# Returns: Salted value
2399 2390
2400FUNCTION se_key_salting(value, salt) 2391FUNCTION se_key_salting(value, salt)
2401 s = (salt * 7) % 64 2392 s = (salt * 7) modulo 64
2402 return (value >> s) | (value << (64 - s)) 2393 return (value >> s) | (value << (64 - s))
2394END FUNCTION
2403 2395
2404 ]]></artwork> 2396 ]]></artwork>
2405 </figure> 2397 </figure>
@@ -2478,7 +2470,7 @@ FUNCTION check_byzantine_bounds (rec,rsd,lec,lsd)
2478 IF (rec < LOWER_BOUND) 2470 IF (rec < LOWER_BOUND)
2479 RETURN FALSE 2471 RETURN FALSE
2480 IF END 2472 IF END
2481 RETURN TRUE 2473 RETURN TRUE
2482FUNCTION END 2474FUNCTION END
2483 ]]></artwork> 2475 ]]></artwork>
2484 </figure> 2476 </figure>
@@ -2582,13 +2574,13 @@ FUNCTION END
2582# Returns TRUE if the message flow was followed, otherwise FALSE 2574# Returns TRUE if the message flow was followed, otherwise FALSE
2583FUNCTION send(store, mt, hash) 2575FUNCTION send(store, mt, hash)
2584 2576
2585 IF NOT store.contains(hash) 2577 IF NOT hash IS IN store
2586 store_element = initialize_element() 2578 store_element = initialize_element()
2587 ELSE 2579 ELSE
2588 store_element = store.get(hash) 2580 store_element = store.get(hash)
2589 END IF 2581 END IF
2590 2582
2591 CASE based on mt 2583 CASE based ON mt
2592 CASE INQUIRY 2584 CASE INQUIRY
2593 IF store_element.INQUIRY == NOT_INITIALIZED 2585 IF store_element.INQUIRY == NOT_INITIALIZED
2594 store_element.INQUIRY = SENT 2586 store_element.INQUIRY = SENT
@@ -2620,8 +2612,8 @@ FUNCTION send(store, mt, hash)
2620 END IF 2612 END IF
2621 DEFAULT 2613 DEFAULT
2622 RETURN FALSE 2614 RETURN FALSE
2623 CASE END 2615 CASE END
2624 store.put(hash,store_element) 2616 ADD OR UPDATE KEY hash IN store WITH store_element
2625 RETURN TRUE 2617 RETURN TRUE
2626FUNCTION END 2618FUNCTION END
2627 2619
@@ -2633,7 +2625,7 @@ FUNCTION END
2633# Output: 2625# Output:
2634# Returns TRUE if the message flow was followed, otherwise FALSE 2626# Returns TRUE if the message flow was followed, otherwise FALSE
2635FUNCTION receive (store, mt, hash) 2627FUNCTION receive (store, mt, hash)
2636 IF NOT store.contains(hash) 2628 IF NOT hash IS IN store
2637 store_element = initialize_element() 2629 store_element = initialize_element()
2638 ELSE 2630 ELSE
2639 store_element = store.get(hash) 2631 store_element = store.get(hash)
@@ -2669,7 +2661,7 @@ FUNCTION receive (store, mt, hash)
2669 DEFAULT 2661 DEFAULT
2670 RETURN FALSE 2662 RETURN FALSE
2671 CASE END 2663 CASE END
2672 store.put(hash,store_element) 2664 ADD OR UPDATE KEY hash IN store WITH store_element
2673 RETURN TRUE 2665 RETURN TRUE
2674FUNCTION END 2666FUNCTION END
2675 2667