adds the key schedule for a round to a state matrix.
@returns void
976162
protected function addRoundKey($round)
    {
        $temp = '';

        for ($i = 0; $i < 4; ++$i) {
            for ($j = 0; $j < self::$nb; ++$j) {
                // place the i-th byte of the j-th word from expanded key w into temp
                        $temp = $this->word[$round * self::$nb + $j] >> (3 - $i) * 8;
                        // Cast temp from a 32-bit word into an 8-bit byte.
                        $temp %= 256;
                        // Can't do unsigned shifts, so we need to make this temp positive
                        $temp = ($temp < 0 ? (256 + $temp) : $temp);

                $this->state[$i][$j] ^= $temp; // xor temp with the byte at location (i,j) of the state
            }
        }
    }
448677
private function computeScheduleInsertsChangeSets() : void
    {
        foreach ($this->documentInsertions as $document) {
            $class = $this->dm->getClassMetadata(get_class($document));
            if ($class->isEmbeddedDocument) {
                continue;
            }

            $this->computeChangeSet($class, $document);
        }
    }
896945
public function addScheduleAction()
    {
        try {
            execute(new CreateScheduleCommand(
                Binput::get('name'),
                Binput::get('message', null, false, false),
                Binput::get('status', Schedule::UPCOMING),
                Binput::get('scheduled_at'),
                Binput::get('completed_at'),
                Binput::get('components', [])
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.schedule.create')
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.edit.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.schedule')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.add.success')));
    }
163213
public function next()
	{
		$this->key++;
		$this->current = $this->current->add($this->interval);
	}
1250952
private void updateCands() {
        if (!this.dense) { connectOccs(); }
        assert !this.schedule;
        this.schedule = true;
        if (this.schedule = currentCands().empty()) { for (int idx = 1; idx <= maxvar(); idx++) { touch(idx); } }
        this.schedule = true;
        touchFixed();
    }
816608
public function onBeforeWrite()
    {
        if (!$this->owner->MFAEnabled && SiteConfig::current_site_config()->ForceMFA) {
            $this->owner->MFAEnabled = true;
            $this->owner->updateMFA = true;
        }
        if (!$this->owner->BackupCodeSalt || $this->owner->updateMFA) {
            $algorithm = Security::config()->get('password_encryption_algorithm');

            $encryptor = PasswordEncryptor::create_for_algorithm($algorithm);

            // No password. It's not even used in the salt generation
            $this->owner->BackupCodeSalt = $encryptor->salt('');
        }
    }
820903
public function addConstraints()
    {
        $parentTable = $this->parent->getTable();

        $this->setJoin();
        if (static::$constraints && !$this->throughKey) {
            $localValue = $this->farParent[$this->localKey];
            $this->query->where($parentTable.'.'.$this->firstKey, '=', $localValue);
        } else {
            $localValue = $this->farParent['id'];
            $this->query->where($this->firstKey . '.' . $this->farParentRelatedKey, '=', $localValue);
        }

    }
1072759
def add_scheduling_blocks(num_blocks, clear=True):
    """"""
    db_client = ConfigDb()
    if clear:
        LOG.info('Resetting database ...')
        db_client.clear()
        start_sbi_id = 0
        start_pb_id = 0
    else:
        start_sbi_id = len(db_client.get_sched_block_instance_ids())
        start_pb_id = len(db_client.get_processing_block_ids())

    LOG.info("Adding %i SBIs to the db", num_blocks)
    for config in _scheduling_block_config(num_blocks, start_sbi_id,
                                           start_pb_id):
        LOG.info('Creating SBI %s with %i PBs.', config['id'],
                 len(config['processing_blocks']))
        db_client.add_sched_block_instance(config)
902908
public void setupKeys()
    {
        KeyAreaInfo keyArea = null;
        keyArea = new KeyAreaInfo(this, Constants.UNIQUE, ID_KEY);
        keyArea.addKeyField(ID, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, START_DATE_TIME_KEY);
        keyArea.addKeyField(START_DATE_TIME, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, ANNIV_MASTER_ID_KEY);
        keyArea.addKeyField(ANNIV_MASTER_ID, Constants.ASCENDING);
        keyArea.addKeyField(START_DATE_TIME, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, CALENDAR_CATEGORY_ID_KEY);
        keyArea.addKeyField(CALENDAR_CATEGORY_ID, Constants.ASCENDING);
        keyArea.addKeyField(START_DATE_TIME, Constants.ASCENDING);
    }
1278262
public void setupKeys()
    {
        KeyAreaInfo keyArea = null;
        keyArea = new KeyAreaInfo(this, Constants.UNIQUE, ID_KEY);
        keyArea.addKeyField(ID, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, START_DATE_TIME_KEY);
        keyArea.addKeyField(START_DATE_TIME, Constants.ASCENDING);
    }
3332
private static function init()
    {
        $day = Calendar::getFirstWeekday();
        $day = $day == 0 ? 7 : $day;
        self::$weekStartsAt = $day;

        $days = self::$days;
        while (array_keys($days)[0] != $day) {
            $key = array_keys($days)[0];
            $value = $days[$key];
            unset($days[$key]);
            $days[$key] = $value;
        }

        self::$init = true;
    }
959208
public function updateStateTransitionMatrix(array $matrix)
    {
        // Do some cleanup, we don't need to store too many things
        foreach ($matrix as $from => $toList) {
            foreach ($toList as $to => $roleList) {
                $current = array_filter($roleList);
                if ($from == $to || empty($current)) {
                    unset($matrix[$from][$to]);
                } else {
                    // Store the role list as key-value for easier usage
                    $matrix[$from][$to] = array_combine($current, $current);
                }
            }
        }
        variable_set('ucms_site_state_transition_matrix', $matrix);
    }
799284
function(state, roundKey)
		{
			state = this.subBytes(state,false);
			state = this.shiftRows(state,false);
			state = this.mixColumns(state,false);
			state = this.addRoundKey(state, roundKey);
			return state;
		}
504824
public function addRound()
	{
		++$this->_currentRoundNo;

		$new_round = $this->_newRound();

		$this->_rounds->offsetSet($this->_currentRoundNo, $new_round);

		return $new_round;
	}
501263
function _setupKey()
    {
        if (!isset($this->key)) {
            $this->setKey('');
        }

        // Key has already been expanded in Crypt_RC2::setKey():
        // Only the first value must be altered.
        $l = unpack('Ca/Cb/v*', $this->key);
        array_unshift($l, $this->pitable[$l['a']] | ($l['b'] << 8));
        unset($l['a']);
        unset($l['b']);
        $this->keys = $l;
    }
699651
public function setRounds($rounds, $lock = false)
    {
        if ($this->rounds_lock === true)
        {
            throw new RockPaperScissorsSpockLizardException('The ability to set rounds has been locked for this game');
        }
        
        if (!is_numeric($rounds)) {
            throw new RockPaperScissorsSpockLizardException('Invalid value supplied for setRounds().');
        }
        
        if (!is_bool($lock)) {
            throw new RockPaperScissorsSpockLizardException('Lock parameter must be a boolean.');
        }
        
        $this->rounds_lock = (bool) $lock;
        $this->rounds = (int) $rounds;

        return $this;
    }
928554
private static function round($state, $roundKey){
		$state = self::subBytes($state,false);
		$state = self::shiftRows($state,false);
		$state = self::mixColumns($state,false);
		$state = self::addRoundKey($state, $roundKey);
		return $state;
	}