other-->Key25519 instance
160464
def get_ecdh_key(self, other):
        '''
        
        '''
        if self.__secretkey is None:
            raise KeyTypeError('Wrong key type for operation')
        # Copy because curve25519_dh_CreateSharedKey changes secretkey
        tmp_secretkey = ffi.new(C_SECRETKEY, self.secretkey)
        ecdh_key = ffi.new(C_SHAREDKEY)
        lib.curve25519_dh_CreateSharedKey(
            ecdh_key, other.pubkey, tmp_secretkey)
        del tmp_secretkey
        return ffi.get_bytes(ecdh_key)
1184763
def uniquekeys(self, metakey=None):
        
        if metakey is None:
            return self._uniquekeys
        else:
            if metakey not in self.metakeys():
                raise ValueError('metakey %s does not exist' % metakey)
            return self._uniquekeys[metakey]
86132
def b(memo, other)
      other.keys.each do |sort|
        if keys.include?(sort) && !memo.keys.include?(sort)
          memo << other.assoc(sort)
        end
      end
    end
710131
def customPRF512(key, amac, smac, anonce, snonce):
    """"""
    A = b"Pairwise key expansion"
    B = b"".join(sorted([amac, smac]) + sorted([anonce, snonce]))

    blen = 64
    i = 0
    R = b''
    while i <= ((blen * 8 + 159) / 160):
        hmacsha1 = hmac.new(key, A + chb(0x00) + B + chb(i), hashlib.sha1)
        i += 1
        R = R + hmacsha1.digest()
    return R[:blen]
836823
def parent_key
      groups = self.c000.split('-').reverse!
      changed = false
      groups.map! do |group|
        if changed || group == "00000"
          group
        else
          changed = true
          "00000"
        end
      end
      c000 = groups.reverse!.join('-')
    end
371950
def key_exists(key_id, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    r = {}
    try:
        key = conn.describe_key(key_id)
        # TODO: add to context cache
        r['result'] = True
    except boto.exception.BotoServerError as e:
        if isinstance(e, boto.kms.exceptions.NotFoundException):
            r['result'] = False
            return r
        r['error'] = __utils__['boto.get_error'](e)
    return r
1265260
def keypair():
    '''
    
    '''
    fields = [
        ('User ID', 'user_id'),
        ('Access Key', 'access_key'),
        ('Secret Key', 'secret_key'),
        ('Active?', 'is_active'),
        ('Admin?', 'is_admin'),
        ('Created At', 'created_at'),
        ('Last Used', 'last_used'),
        ('Res.Policy', 'resource_policy'),
        ('Rate Limit', 'rate_limit'),
        ('Concur.Limit', 'concurrency_limit'),
        ('Concur.Used', 'concurrency_used'),
    ]
    with Session() as session:
        try:
            kp = session.KeyPair(session.config.access_key)
            info = kp.info(fields=(item[1] for item in fields))
        except Exception as e:
            print_error(e)
            sys.exit(1)
        rows = []
        for name, key in fields:
            rows.append((name, info[key]))
        print(tabulate(rows, headers=('Field', 'Value')))
382862
def unique_key(connection):
    
    while 1:
        key = str(uuid.uuid4().hex)
        if not connection.exists(key):
            break
    return key
645259
def unioniter(self, *others):
        
        others = self._typesafe_others(others)
        for other in self._client.sunion(self.key_prefix, *others):
            yield self._loads(other)
506879
private boolean sameKeys(KTypeSet<?> other) {
    if (other.size() != size()) {
      return false;
    }

    for (KTypeCursor<?> c : other) {
      if (!contains(Intrinsics.<KType> cast(c.value))) {
        return false;
      }
    }

    return true;
  }
1210097
def key_type(key, host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.type(key)
416514
def hexists(self):
        
        try:
            key = self.key
        except DoesNotExist:
            """
            If the object doesn't exists anymore, its PK is deleted, so the
            "self.key" call will raise a DoesNotExist exception. We catch it
            to return False, as the field doesn't exists too.
            """
            return False
        else:
            return self.connection.hexists(key, self.name)
211489
def -(other)
      raise "#{self.class} cannot handle #{other.class} with the minus operator" unless other.class == Permissions

      self_hash = Permissions.hashnize(self)
      other_hash = Permissions.hashnize(other)

      diff_permissions = (self_hash.keys - other_hash.keys).map do |key|
        self_hash[key]
      end

      Permissions.new(diff_permissions)
    end
991065
private void ckeckKey(KeyType keyType) {
		switch (keyType) {
		case PublicKey:
			if (null == this.publicKey) {
				throw new NullPointerException("No public key provided");
			}
			break;
		case PrivateKey:
			if (null == this.privateKey) {
				throw new NullPointerException("No private key provided");
			}
			break;
		}
	}
334846
def key_pair_from_ed25519_key(hex_private_key):
    """"""
    priv_key = crypto.Ed25519SigningKey(bytes.fromhex(hex_private_key)[:32], encoding='bytes')
    public_key = priv_key.get_verifying_key()
    return CryptoKeypair(private_key=priv_key.encode(encoding='base58').decode('utf-8'),
                         public_key=public_key.encode(encoding='base58').decode('utf-8'))
116216
public void onHostKeyMismatch(String host, SshPublicKey pk,
			SshPublicKey actual) {
		try {
			System.out.println("The host key supplied by " + host + "("
					+ pk.getAlgorithm() + ")" + " is: "
					+ actual.getFingerprint());
			System.out.println("The current allowed key for " + host + " is: "
					+ pk.getFingerprint());
			getResponse(host, actual);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
728408
MAC newReadMAC() throws NoSuchAlgorithmException, InvalidKeyException {
        MacAlg macAlg = cipherSuite.macAlg;
        MAC mac;
        if (isClient) {
            mac = macAlg.newMac(protocolVersion, svrMacSecret);
            svrMacSecret = null;
        } else {
            mac = macAlg.newMac(protocolVersion, clntMacSecret);
            clntMacSecret = null;
        }
        return mac;
    }