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

Method zip

ctutils/src/ct_option.rs:494–499  ·  view source on GitHub ↗

Zips `self` with another [`CtOption`]. If `self.is_some() && other.is_some()`, this method returns a new [`CtOption`] for a 2-tuple of their contents where `is_some()` is [`Choice::TRUE`]. Otherwise, a [`CtOption`] where `is_some()` is [`Choice::FALSE`] is returned.

(self, other: CtOption<U>)

Source from the content-addressed store, hash-verified

492 ///
493 /// Otherwise, a [`CtOption`] where `is_some()` is [`Choice::FALSE`] is returned.
494 pub fn zip<U>(self, other: CtOption<U>) -> CtOption<(T, U)> {
495 CtOption {
496 value: (self.value, other.value),
497 is_some: self.is_some & other.is_some,
498 }
499 }
500
501 /// Zips `self` and another `CtOption` with function `f`.
502 ///

Callers 12

absorb_fullFunction · 0.80
absorb_partialFunction · 0.80
squeeze_read_fullFunction · 0.80
squeeze_read_partialFunction · 0.80
squeeze_xor_fullFunction · 0.80
squeeze_xor_partialFunction · 0.80
zip_withMethod · 0.80
ct_eq_sliceMethod · 0.80
ct_assign_sliceMethod · 0.80
cmovnzMethod · 0.80
cmovneMethod · 0.80
word_to_sliceFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected