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

Method zip

ctutils/src/ct_option.rs:496–501  ·  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

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

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