From 857a2bbca9872faf3ca0dcb81596b902112a969b Mon Sep 17 00:00:00 2001 From: Anders Martinsson Date: Tue, 18 Feb 2020 16:46:43 +0100 Subject: [PATCH] Compatibility correction when P is prime number RFC 6330: "P1 denote the smallest prime number greater than or equal to P." Signed-off-by: Anders Martinsson --- src/RaptorQ/v1/Parameters.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/RaptorQ/v1/Parameters.hpp b/src/RaptorQ/v1/Parameters.hpp index 87a3866..f098d7b 100644 --- a/src/RaptorQ/v1/Parameters.hpp +++ b/src/RaptorQ/v1/Parameters.hpp @@ -89,8 +89,9 @@ inline Parameters::Parameters (const uint16_t symbols) P = L - W; U = P - H; B = W - S; - P1 = P + 1; // first prime number bigger than P. turns out its - // always between 1 and 14 more numbers. + P1 = P; // RFC 6330, pg 22, P1 denotes the smallest prime + // number greater than or equal to P. Turns out its + // always between 0 and 14 more numbers. while (!is_prime (P1)) // so this while will be really quick anyway ++P1; } -- GitLab