def exp size_bits
      @mutex.synchronize do
        while @pool_size < size_bits
          # Push 32×8 bits to the pool.
          SecureRandom.random_bytes(32).unpack('Q*').each do |byte|
            @pool = (@pool << 64) | byte
            @pool_size += 64
          end
        end

        # Unshift size_bits bits from the pool.
        @pool_size -= size_bits
        bits   = @pool >> @pool_size
        @pool ^= bits << @pool_size

        bits
      end
    end
def exp size_bits
      @mutex.synchronize do
        while @pool_size < size_bits
          # Push 32×8 bits to the pool.
          SecureRandom.random_bytes(32).unpack('Q*').each do |byte|
            @pool = (@pool << 64) | byte
            @pool_size += 64
          end
        end

        # Unshift size_bits bits from the pool.
        @pool_size -= size_bits
        bits   = @pool >> @pool_size
        @pool ^= bits << @pool_size

        bits
      end
    end
0 ≤ return_value < 2^size_bits