Skip to content

Clarify assembly review #109

@sonti-lurker

Description

@sonti-lurker

subtle/src/lib.rs

Lines 332 to 338 in 6b6a81a

// This loop shouldn't be shortcircuitable, since the compiler
// shouldn't be able to reason about the value of the `u8`
// unwrapped from the `ct_eq` result.
let mut x = 1u8;
for (ai, bi) in self.iter().zip(_rhs.iter()) {
x &= ai.ct_eq(bi).unwrap_u8();
}

Doesn't really rule out a simple if x == 0 goto end optimization. I assume the assembly was inspected but that should probably be annotated because it would have to be repeated when the compiler does smarter things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions