]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hashx: minor, another logical operator change
authorMicah Elizabeth Scott <beth@torproject.org>
Wed, 24 May 2023 20:20:58 +0000 (13:20 -0700)
committerMicah Elizabeth Scott <beth@torproject.org>
Mon, 29 May 2023 02:54:50 +0000 (19:54 -0700)
The code style in equix and hashx sometimes uses bitwise operators
in place of logical ones in cases where it doesn't really matter
either way. This sometimes annoys our static analyzer tools.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
src/ext/equix/hashx/src/program.c

index f144ce14a00779540c16df390a38eb2d9a326e71..b44bdb855aab6fa458f7e01c436c9f1e02a760c1 100644 (file)
@@ -712,8 +712,8 @@ bool hashx_program_generate(const siphash_state* key, hashx_program* program) {
        /* reject programs that don't meet the uniform complexity requirements */
        /* this happens in less than 1 seed out of 10000 */
        return
-               (program->code_size == REQUIREMENT_SIZE) &
-               (ctx.mul_count == REQUIREMENT_MUL_COUNT) &
+               (program->code_size == REQUIREMENT_SIZE) &&
+               (ctx.mul_count == REQUIREMENT_MUL_COUNT) &&
                (ctx.latency == REQUIREMENT_LATENCY - 1); /* cycles are numbered from 0 */
 }