Skip to content

Commit

Permalink
Spec alignment when adding entries
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavweiss committed Nov 20, 2017
1 parent c587bbc commit d02e5d1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions draft-ietf-httpbis-cache-digest.md
Expand Up @@ -214,23 +214,24 @@ the ETag is available; otherwise, null);
3. Let `N` be the value of the second to fifth bytes of `digest-value` in big endian form.
4. Let `key` be the return value of {{key}} with `URL` and `ETag` as inputs.
5. Let `h1` be the return value of {{hash}} with `key` and `N` as inputs.
6. Let `fingerprint` be the return value of {{fingerprint}} with `key` and `f` as inputs.
7. Let `h2` be the return value of {{hash2}} with `h1`, `fingerprint` and `N` as inputs.
6. Let `dest_fingerprint` be the return value of {{fingerprint}} with `key` and `f` as inputs.
7. Let `h2` be the return value of {{hash2}} with `h1`, `dest_fingerprint` and `N` as inputs.
8. Let `h` be either `h1` or `h2`, picked in random.
9. While `maxcount` is larger than zero:
1. Let `position_start` be 40 + `h` * `f` \* `b`.
2. Let `position_end` be `position_start` + `f` \* `b`.
3. While `position_start` < `position_end`:
1. Let `bits` be `f` bits from `digest_value` starting at `position_start`.
2. If `bits` is all zeros, set `bits` to `fingerprint` and terminate these steps.
2. If `bits` is all zeros, set `bits` to `dest_fingerprint` and terminate these steps.
3. Add `f` to `position_start`.
4. Let `e` be a random number from 0 to `b`.
5. Substract `f` * (`b` - `e`) from `position_start`.
6. Let `bits` be `f` bits from `digest_value` starting at `position_start`.
7. Let `dest_fingerprint` be the value of bits, read as big endian.
8. Set `bits` to `fingerprint`.
9. Let `h` be {{hash2}} with `h`, `dest_fingerprint` and `N` as inputs.
10. Substract 1 from `maxcount`.
7. Let `fingerprint` be the value of bits, read as big endian.
8. Set `bits` to `dest_fingerprint`.
9. Set `dest_fingerprint` to `fingerprint`.
10. Let `h` be {{hash2}} with `h`, `dest_fingerprint` and `N` as inputs.
11. Substract 1 from `maxcount`.
13. Substract `f` from `position_start`.
14. Let `fingerprint` be the `f` bits starting at `position_start`.
15. Let `h1` be `h`
Expand Down

0 comments on commit d02e5d1

Please sign in to comment.