/************************************************************************************* * Description: Checks Bounds for Signature Vector Z During Signification. * Leaks the Position of the Coefficient that Fails the Test. * The Position of the Coefficient is Independent of the Secret Data. * Does not Leak the Signature of the Coefficients. * For Provably-Secure qTESLA Security Category-1 and Security Category-3 * * @param Z Signature Vector * @param n Polynomial Degree * @param b Interval the Randomness is Chosen in During Signification * @param u Bound in Checking Secret Polynomial * * @return false Valid / Accepted * true Invalid / Rejected *************************************************************************************/ private static boolean testRejection(long[] Z, int n, int b, int u) { for (int i = 0; i < n; i++) { if (absolute(Z[i]) > (b - u)) { return true; } } return false; }
/********************************************************************************* * Description: Checks Bounds for Signature Vector Z During Signification. * Leaks the Position of the Coefficient that Fails the Test. * The Position of the Coefficient is Independent of the Secret Data. * Does not Leak the Signature of the Coefficients. * For Heuristic qTESLA Security Category-1 and Security Category-3 * (Option for Size or Speed) * * @param Z Signature Vector * @param n Polynomial Degree * @param b Interval the Randomness is Chosen in During Signification * @param u Bound in Checking Secret Polynomial * * @return false Valid / Accepted * true Invalid / Rejected ********************************************************************************/ private static boolean testRejection(int[] Z, int n, int b, int u) { for (int i = 0; i < n; i++) { if (absolute(Z[i]) > (b - u)) { return true; } } return false; }
list[i] = absolute(polynomial[i]);
list[i] = (short)(absolute(polynomial[offset + i]));
test1 = (~(absolute(right) - (q / 2 - rejection))) >>> 31; left = right; right = (right + (1 << (d - 1)) - 1) >> d; right = left - (right << d); test2 = (~(absolute(right) - ((1 << (d - 1)) - rejection))) >>> 31; test1 = (~(absolute(right) - (q / 2 - rejection))) >>> 63; test2 = (~(absolute(right) - ((1 << (d - 1)) - rejection))) >>> 63;