lib/auth/set-client-dh-params.js
function createAuthKey(context) {
    // Extract the nonces
    var newNonce = utility.string2Buffer(context.newNonce, 32);
    var serverNonce = utility.string2Buffer(context.resPQ.server_nonce, 16);
    // Create the serverSalt
    var serverSalt = utility.xor(newNonce.slice(0, 8), serverNonce.slice(0, 8));
    if (logger.isDebugEnabled()) {
        logger.debug('serverSalt(%s) = %s', serverSalt.length, serverSalt.toString('hex'));
    }
    // Create the AuthKey
    var authKey = new AuthKey(context.authKeyID, context.authKeyValue);
    if (logger.isDebugEnabled()) {
        logger.debug('authKey = %s', authKey.toString());
    }
    return {
        key: authKey,
        serverSalt: serverSalt,
        toPrintable: tl.utility.toPrintable
    };
}
function createAuthKey(context) {
    // Extract the nonces
    var newNonce = utility.string2Buffer(context.newNonce, 32);
    var serverNonce = utility.string2Buffer(context.resPQ.server_nonce, 16);
    // Create the serverSalt
    var serverSalt = utility.xor(newNonce.slice(0, 8), serverNonce.slice(0, 8));
    if (logger.isDebugEnabled()) {
        logger.debug('serverSalt(%s) = %s', serverSalt.length, serverSalt.toString('hex'));
    }
    // Create the AuthKey
    var authKey = new AuthKey(context.authKeyID, context.authKeyValue);
    if (logger.isDebugEnabled()) {
        logger.debug('authKey = %s', authKey.toString());
    }
    return {
        key: authKey,
        serverSalt: serverSalt,
        toPrintable: tl.utility.toPrintable
    };
}
function createAuthKey ( context ) { // Extract the nonces var newNonce = utility . string2Buffer ( context . newNonce , 32 ) ; var serverNonce = utility . string2Buffer ( context . resPQ . server_nonce , 16 ) ; // Create the serverSalt var serverSalt = utility . xor ( newNonce . slice ( 0 , 8 ) , serverNonce . slice ( 0 , 8 ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( 'serverSalt(%s) = %s' , serverSalt . length , serverSalt . toString ( 'hex' ) ) ; } // Create the AuthKey var authKey = new AuthKey ( context . authKeyID , context . authKeyValue ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( 'authKey = %s' , authKey . toString ( ) ) ; } return { key : authKey , serverSalt : serverSalt , toPrintable : tl . utility . toPrintable } ; }
Create the AuthKey
Create the AuthKey