Generates keys for each round
178541
function expandKey(key) {
	let tempWord = new Array(WORD_LENGTH);
	let rounds = getRoundsCount(key);
	let wordsCount = key.length / WORD_LENGTH;
	let keySchedule = new Array(COLUMNS * (rounds + 1));
	
	for (let i = 0; i < wordsCount; i++) {
		keySchedule[i] = key.slice(WORD_LENGTH * i, WORD_LENGTH * i + WORD_LENGTH);
	}
	for (let i = wordsCount; i < keySchedule.length; i++) {
		tempWord = keySchedule[i - 1];
		if (i % wordsCount === 0) {
			tempWord = a_u.xorWords(a_u.subWord(a_u.rotWordLeft(tempWord)), a_u.R_CON[i / wordsCount]);
		} else if (wordsCount > 6 && i % wordsCount === 4) {
			tempWord = a_u.subWord(tempWord);
		}
		keySchedule[i] = a_u.xorWords(keySchedule[i - wordsCount], tempWord);
	}
	return keySchedule;
}
777315
function iterateKeys() {
      var obj = getKeyObject(db, j);
      if(obj === null) return onKeysComplete();
      encoder.write(obj, function onWrite() {
        j++;
        setImmediate(iterateKeys);
      });
    }
922984
function generateKeyPairs () {
  AnvilConnectKeys.generateKeyPair(this.sig.pub, this.sig.prv)
  AnvilConnectKeys.generateKeyPair(this.enc.pub, this.enc.prv)
}
19864
def gen_keys(hsm, args):
    

    if args.verbose:
        print "Generating %i keys :\n" % (args.count)
    else:
        print "Generating %i keys" % (args.count)

    for int_id in range(args.start_id, args.start_id + args.count):
        public_id = ("%x" % int_id).rjust(args.public_id_chars, '0')
        padded_id = pyhsm.yubikey.modhex_encode(public_id)

        if args.verbose:
            print "  %s" % (padded_id)

        num_bytes = len(pyhsm.aead_cmd.YHSM_YubiKeySecret('a' * 16, 'b' * 6).pack())
        hsm.load_random(num_bytes)
        for kh in args.key_handles.keys():
            if args.random_nonce:
                nonce = ""
            else:
                nonce = public_id.decode('hex')
            aead = hsm.generate_aead(nonce, kh)

            filename = output_filename(args.output_dir, args.key_handles[kh], padded_id)

            if args.verbose:
                print "    %4s, %i bytes (%s) -> %s" % \
                    (args.key_handles[kh], len(aead.data), shorten_aead(aead), filename)
            aead.save(filename)

        if args.verbose:
            print ""

    print "\nDone\n"
401361
def make_random_key() -> Text:
    

    r = SystemRandom()
    allowed = \
        'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+/[]'

    return ''.join([r.choice(allowed) for _ in range(0, 50)])
1089036
def _batch_key(self, query):
    '''
    
    '''
    return ''.join( ['%s%s'%(k,v) for k,v in sorted(query.items())] )
466036
def generate_key(low=7, high=10, lower_only=False):
    
    return random_alphanum(length=randint(7, 10), lower_only=lower_only)
814309
def iteritems(self, pattern="*"):
        """"""
        for key in self.keys(pattern):
            yield (key, self[key])
1367873
def for_each_time_range(t)
      RedisAnalytics.redis_key_timestamps.map{|x, y| t.strftime(x)}.each do |ts|
        yield(ts)
      end
    end
629554
def each_key(key, &block)
      index = 0
      subkey = nil

      subkey_max_len, _ = reg_query_info_key_max_lengths(key)

      begin
        subkey, filetime = reg_enum_key(key, index, subkey_max_len)
        yield subkey, filetime if !subkey.nil?
        index += 1
      end while !subkey.nil?

      index
    end
1242258
def make_key(self, *parts):
        """"""
        separator = getattr(self.model_class, 'index_separator', '.')
        parts = map(decode, parts)
        return '%s%s' % (self._base_key, separator.join(map(str, parts)))
1256039
private static String generateKey(int num) {
        Random random = new Random();
        String key = "";

        for (int x = 0; x < num; x++) {
            key += CHARACTERS[random.nextInt(CHARACTERS.length)];
        }
        return key;
    }
659519
def iteritems(self):
        ''''''
        for x in range(len(self.keys)):
            yield (self.keys[x], self.values[x])
450304
def keys(pattern = nil, secret_only = nil)
      keys = []
      each_key(pattern, secret_only) do |key|
        keys << key
      end
      keys
    end
609110
def roundrobin(*iterables):
    ""
    # Recipe credited to George Sakkis
    pending = len(iterables)
    nexts = itertools.cycle(iter(it).next for it in iterables)
    while pending:
        try:
            for next in nexts:
                yield next()
        except StopIteration:
            pending -= 1
            nexts = itertools.cycle(itertools.islice(nexts, pending))
64941
def each_key(pattern = nil, secret_only = false, &block)
      keylist_start(pattern, secret_only)
      begin
        loop { yield keylist_next }
      rescue EOFError
        # The last key in the list has already been returned.
      ensure
        keylist_end
      end
    end
165688
def iterkeys(self):
        """"""
        patterns = self.patterns
        replace = self.replace
        seen = set()
        for key in six.iterkeys(self.base):
            for pattern in patterns:
                m = pattern.match(key)
                if m:
                    ret = m.group('key') if replace else m.group()
                    if ret not in seen:
                        seen.add(ret)
                        yield ret
                    break
        for key in DictMethods.iterkeys(self):
            if key not in seen:
                yield key