Skip to main content

shr128_to_u64_const

Function shr128_to_u64_const 

Source
pub fn shr128_to_u64_const(
    b: &CircuitBuilder,
    hi: Wire,
    lo: Wire,
    s: u32,
) -> Wire
Expand description

Right-shift a 128-bit value by a small constant and return the low 64 bits.

Given p = (hi << 64) | lo, computes (p >> s).lo64 = (lo >> s) | (hi << (64 - s))

§Parameters

  • hi: High 64 bits of 128-bit value
  • lo: Low 64 bits of 128-bit value
  • s: Shift amount (must be 0 < s < 64)

§Returns

Low 64 bits of the right-shifted result