qkd-error-estimation should render to an optimal output size
Problem: an optimal error correction algorithm may work an exact chunks of input symbols, e.g. 2^10 symbols. Therefore the error estimation should produce an exact output size, since it is this what is then fed to an error correction module. This is hard to achieve on a fixed disclose ratio.
Example: if the desired output is 2^20 symbols (which could be fed to 8 parallel error correction modules with 2^17 symbols in a key each), we have to find a ratio which results in exactly 2^20 symbols. Moreover: the chunk of disclosed key symbols might be a multiple of 8. Last but not least the amount of disclosed bits should be around 10%.
- 2^20 + x = y
- y % 8 = 0
- x % 8 = 0
- |0,1 - x/y| <= epsilon
Solve this. =)
or (new option)
regardless of the input size, declare a desired output size and a minimum ratio to be reasonable.
- output-size = 2^20
- minimum-ratio = 0.08
- disclosed-size = input-size - output-size
- disclosed-ratio = disclosed-size / input-size
- ok? == disclosed-ratio >= minimum-ratio
And we can work on keys of variable sizes too...
#1 Updated by Oliver Maurhart about 1 year ago
- Status changed from Assigned to Feedback
Done in a98a08fe.Both discrete and continuous support now two modes:
- mode value 0 ---> DISCLOSE_MODE_FIXED_RATIO: do as before. The configuration value of "ratio_disclose" is used to randomly draw a fixed portion of the key for comparison with the peer.
- mode value 1 ---> DISCLOSE_MODE_FIXED_OUTPUT: new. The configuration value of "output_size" is used. The current size minus the targeted output size is disclosed for comparison with the peer. The value of "ratio_minimum" is used to check if a portion of the key has been disclosed to get reasonable estimation values. This minimum ratio defaults currently to 0.08 (8%).
Hence, when doing mode 1 (fixed output size) we might get negative amounts of symbols to disclose. This is the case if the total amount of key symbols is less than the desired output size. In both cases, negative amount of disclosed bits and failed to disclose a minimum ratio, the key is discarded.
@christoph: please check if this behavior makes sense.