// Sets the counter of the cipher.
// Notice that this function skips the unused
// keystream of the current 64 byte block.
333277
func (c *Cipher) SetCounter(ctr uint32) {
	c.state[48] = byte(ctr)
	c.state[49] = byte(ctr >> 8)
	c.state[50] = byte(ctr >> 16)
	c.state[51] = byte(ctr >> 24)
	c.off = 0
}
239992
func (c *CipherWriter) Reset(w io.Writer, mask [4]byte) {
	c.w = w
	c.mask = mask
	c.pos = 0
}
670306
func (env *Env) SetInt64(key string, value int64) {
	env.Set(key, strconv.FormatInt(value, 10))
}
486463
func (ms *MetricSystem) Counter(name string, amount uint64) {
	ms.counterMu.RLock()
	_, exists := ms.counterCache[name]
	// perform lock promotion when we need more control
	if exists {
		atomic.AddUint64(ms.counterCache[name], amount)
		ms.counterMu.RUnlock()
	} else {
		ms.counterMu.RUnlock()
		ms.counterMu.Lock()
		_, syncExists := ms.counterCache[name]
		if !syncExists {
			var z uint64
			ms.counterCache[name] = &z
		}
		atomic.AddUint64(ms.counterCache[name], amount)
		ms.counterMu.Unlock()
	}
}
1181237
func (s *ListThingsInThingGroupInput) SetRecursive(v bool) *ListThingsInThingGroupInput {
	s.Recursive = &v
	return s
}
755624
func (h *syncHandler) Set(key string, value interface{}, args ...interface{}) error {
	defer h.mutex.Unlock()
	h.mutex.Lock()
	return h.handler.Set(key, value, args...)
}
150267
func (r *Redis) SetBit(key string, offset, value int) (int64, error) {
	rp, err := r.ExecuteCommand("SETBIT", key, offset, value)
	if err != nil {
		return 0, err
	}
	return rp.IntegerValue()
}
1300597
func (w *BlockWrapper) SetNumber(number uint64) {
	w.block.Header.Number = number
}
1110556
func (s *Run) SetCounters(v *Counters) *Run {
	s.Counters = v
	return s
}
286466
func (i *Uint8) Set(value uint8) {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment = value
}
86714
func (p *ProgressBar) Set(num int) error {
	return p.Set64(int64(num))
}
137026
func (b *Bucket) Counter(key string, delta, initial int64, expiry uint32) (uint64, Cas, error) {
	val, cas, _, err := b.counter(key, delta, initial, expiry)
	return val, cas, err
}
1096302
func (ba *bitArray) SetBit(k uint64) error {
	if k >= ba.Capacity() {
		return OutOfRangeError(k)
	}

	if !ba.anyset {
		ba.lowest = k
		ba.highest = k
		ba.anyset = true
	} else {
		if k < ba.lowest {
			ba.lowest = k
		} else if k > ba.highest {
			ba.highest = k
		}
	}

	i, pos := getIndexAndRemainder(k)
	ba.blocks[i] = ba.blocks[i].insert(pos)
	return nil
}
116661
func (g *gcm) counterCrypt(out, in []byte, counter *[gcmBlockSize]byte) {
	var mask [gcmBlockSize]byte

	for len(in) >= gcmBlockSize {
		g.cipher.Encrypt(mask[:], counter[:])
		gcmInc32(counter)

		xorWords(out, in, mask[:])
		out = out[gcmBlockSize:]
		in = in[gcmBlockSize:]
	}

	if len(in) > 0 {
		g.cipher.Encrypt(mask[:], counter[:])
		gcmInc32(counter)
		xorBytes(out, in, mask[:])
	}
}
917563
func (g Gauge) SetBatchFunc(key interface{}, init func(), f func() int64) {
	gm.Lock()
	defer gm.Unlock()

	gauges[string(g)] = f
	if _, ok := inits[key]; !ok {
		inits[key] = init
	}
}
714121
func (c Counter) SetFunc(f func() uint64) {
	cm.Lock()
	defer cm.Unlock()

	counterFuncs[string(c)] = f
}
473128
func setBit(n int, pos int) int {
	n |= (1 << uint(pos))
	return n
}