You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ctutils: split CtAssign out of CtSelect [BREAKING]
Note: version bumped to v0.4.0-pre to denote breaking change (not for
release)
Extracts the `ct_assign` method into its own trait. The main advantage
of this is the `CtSelect` trait requires a `Sized` bound, where an
independent `CtAssign` trait does not, which means it can be impl'd for
slices as a sort of conditional `copy_from_slice`.
The main disadvantage is we lose the default implementation, so it
becomes one more trait to impl. There's no good way to blanket impl one
in terms of the other that won't preclude efficient implementations in
some way or another, so this opts not to do that for maximum
flexibility.
To preserve `subtle`-like ergonomics where `CtSelect` means we can
`CtAssign` as well, this bounds `CtSelect` on `CtAssign`.
Finally, the same treatment is given to the `Bytes*` traits, with a
`BytesCtAssign` split out of `BytesCtSelect` for parity, and an impl of
`BytesCtAssign` for `[u8]` has been added.
0 commit comments