MCPcopy Create free account
hub / github.com/RustCrypto/utils / ct_select

Function ct_select

ctutils/src/choice.rs:648–653  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

646
647 #[test]
648 fn ct_select() {
649 let a = Choice::FALSE;
650 let b = Choice::TRUE;
651 assert_eq!(a.ct_select(&b, Choice::FALSE).to_bool(), a.to_bool());
652 assert_eq!(a.ct_select(&b, Choice::TRUE).to_bool(), b.to_bool());
653 }
654
655 #[test]
656 fn and() {

Callers 4

conditional_selectMethod · 0.70
ct_assignMethod · 0.50
ct_swapMethod · 0.50
ct_select_arrayMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected