B = (k*v + g^b) % N

        :param int password_verifier:
        :param int server_private:
        :rtype: int
172674
def get_server_public(self, password_verifier, server_private):
        
        return ((self._mult * password_verifier) + pow(self._gen, server_private, self._prime)) % self._prime
1207910
def k_bn(self, n, Re):
        
        bn = self.b_n(n)
        k = bn*Re**(-1./n)
        return k, bn
13773
function hash_password(plain_text, salt, callback) {
  // Get the crypto library.
  const crypto = require("crypto")

  // These should be a *slow* as possible, higher = slower.
  // Slow it down until you tweak a bounce change.
  const password_iterations = process.env.PW_GEN_PW_ITERS || 4096

  // Password length and algorithm.
  const password_length = process.env.PW_GEN_PW_LENGTH || 512
  const password_algorithm = process.env.PW_GEN_PW_ALG || "sha256"

  // Create a hash, we're going to encrypt the password.
  // I wish Node had native support for good KDF functions
  // like bcrypt or scrypt but PBKDF2 is good for now.
  crypto.pbkdf2(plain_text, salt, password_iterations, password_length, password_algorithm, (err, key) => {
    // Move on.
    callback(key.toString("hex"), salt)
  })
}
587247
def hash_password(plaintextpw: str,
                  log_rounds: int = BCRYPT_DEFAULT_LOG_ROUNDS) -> str:
    
    salt = bcrypt.gensalt(log_rounds)  # optional parameter governs complexity
    hashedpw = bcrypt.hashpw(plaintextpw, salt)
    return hashedpw
1302742
public static final void verify(byte[] Y, byte[] v, byte[] h, byte[] P) {
		/* Y = v abs(P) + h G  */
		byte[] d=new byte[32];
	    long10[] 
	        p=new long10[]{new long10(),new long10()},
	    	s=new long10[]{new long10(),new long10()},
		    yx=new long10[]{new long10(),new long10(),new long10()},
		    yz=new long10[]{new long10(),new long10(),new long10()},
		    t1=new long10[]{new long10(),new long10(),new long10()},
		    t2=new long10[]{new long10(),new long10(),new long10()};
		
		int vi = 0, hi = 0, di = 0, nvh=0, i, j, k;

		/* set p[0] to G and p[1] to P  */

		set(p[0], 9);
		unpack(p[1], P);

		/* set s[0] to P+G and s[1] to P-G  */

		/* s[0] = (Py^2 + Gy^2 - 2 Py Gy)/(Px - Gx)^2 - Px - Gx - 486662  */
		/* s[1] = (Py^2 + Gy^2 + 2 Py Gy)/(Px - Gx)^2 - Px - Gx - 486662  */

		x_to_y2(t1[0], t2[0], p[1]);	/* t2[0] = Py^2  */
		sqrt(t1[0], t2[0]);	/* t1[0] = Py or -Py  */
		j = is_negative(t1[0]);		/*      ... check which  */
		t2[0]._0 += 39420360;		/* t2[0] = Py^2 + Gy^2  */
		mul(t2[1], BASE_2Y, t1[0]);/* t2[1] = 2 Py Gy or -2 Py Gy  */
		sub(t1[j], t2[0], t2[1]);	/* t1[0] = Py^2 + Gy^2 - 2 Py Gy  */
		add(t1[1-j], t2[0], t2[1]);/* t1[1] = Py^2 + Gy^2 + 2 Py Gy  */
		cpy(t2[0], p[1]);		/* t2[0] = Px  */
		t2[0]._0 -= 9;			/* t2[0] = Px - Gx  */
		sqr(t2[1], t2[0]);		/* t2[1] = (Px - Gx)^2  */
		recip(t2[0], t2[1], 0);	/* t2[0] = 1/(Px - Gx)^2  */
		mul(s[0], t1[0], t2[0]);	/* s[0] = t1[0]/(Px - Gx)^2  */
		sub(s[0], s[0], p[1]);	/* s[0] = t1[0]/(Px - Gx)^2 - Px  */
		s[0]._0 -= 9 + 486662;		/* s[0] = X(P+G)  */
		mul(s[1], t1[1], t2[0]);	/* s[1] = t1[1]/(Px - Gx)^2  */
		sub(s[1], s[1], p[1]);	/* s[1] = t1[1]/(Px - Gx)^2 - Px  */
		s[1]._0 -= 9 + 486662;		/* s[1] = X(P-G)  */
		mul_small(s[0], s[0], 1);	/* reduce s[0] */
		mul_small(s[1], s[1], 1);	/* reduce s[1] */


		/* prepare the chain  */
		for (i = 0; i < 32; i++) {
			vi = (vi >> 8) ^ (v[i] & 0xFF) ^ ((v[i] & 0xFF) << 1);
			hi = (hi >> 8) ^ (h[i] & 0xFF) ^ ((h[i] & 0xFF) << 1);
			nvh = ~(vi ^ hi);
			di = (nvh & (di & 0x80) >> 7) ^ vi;
			di ^= nvh & (di & 0x01) << 1;
			di ^= nvh & (di & 0x02) << 1;
			di ^= nvh & (di & 0x04) << 1;
			di ^= nvh & (di & 0x08) << 1;
			di ^= nvh & (di & 0x10) << 1;
			di ^= nvh & (di & 0x20) << 1;
			di ^= nvh & (di & 0x40) << 1;
			d[i] = (byte)di;
		}

		di = ((nvh & (di & 0x80) << 1) ^ vi) >> 8;

		/* initialize state */
		set(yx[0], 1);
		cpy(yx[1], p[di]);
		cpy(yx[2], s[0]);
		set(yz[0], 0);
		set(yz[1], 1);
		set(yz[2], 1);

		/* y[0] is (even)P + (even)G
		 * y[1] is (even)P + (odd)G  if current d-bit is 0
		 * y[1] is (odd)P + (even)G  if current d-bit is 1
		 * y[2] is (odd)P + (odd)G
		 */

		vi = 0;
		hi = 0;

		/* and go for it! */
		for (i = 32; i--!=0; ) {
			vi = (vi << 8) | (v[i] & 0xFF);
			hi = (hi << 8) | (h[i] & 0xFF);
			di = (di << 8) | (d[i] & 0xFF);

			for (j = 8; j--!=0; ) {
				mont_prep(t1[0], t2[0], yx[0], yz[0]);
				mont_prep(t1[1], t2[1], yx[1], yz[1]);
				mont_prep(t1[2], t2[2], yx[2], yz[2]);

				k = ((vi ^ vi >> 1) >> j & 1)
				  + ((hi ^ hi >> 1) >> j & 1);
				mont_dbl(yx[2], yz[2], t1[k], t2[k], yx[0], yz[0]);

				k = (di >> j & 2) ^ ((di >> j & 1) << 1);
				mont_add(t1[1], t2[1], t1[k], t2[k], yx[1], yz[1],
						p[di >> j & 1]);

				mont_add(t1[2], t2[2], t1[0], t2[0], yx[2], yz[2],
						s[((vi ^ hi) >> j & 2) >> 1]);
			}
		}

		k = (vi & 1) + (hi & 1);
		recip(t1[0], yz[k], 0);
		mul(t1[1], yx[k], t1[0]);

		pack(t1[1], Y);
	}
1085687
def encrypt(self, k, a, m):
        
        hkey = k[:_inbytes(self.keysize)]
        ekey = k[_inbytes(self.keysize):]

        # encrypt
        iv = _randombits(self.blocksize)
        cipher = Cipher(algorithms.AES(ekey), modes.CBC(iv),
                        backend=self.backend)
        encryptor = cipher.encryptor()
        padder = PKCS7(self.blocksize).padder()
        padded_data = padder.update(m) + padder.finalize()
        e = encryptor.update(padded_data) + encryptor.finalize()

        # mac
        t = self._mac(hkey, a, iv, e)

        return (iv, e, t)
713293
def verifyG1(x, tTilde, y, pi, errorOnFail=True):
    
    # Unpack the proof
    p,c,u = pi

    # Verify types
    assertType(x, G1Element)
    assertType(tTilde, G2Element)
    assertType(y, GtElement)
    assertType(p, G1Element)

    # TODO: beta can be pre-computed while waiting for a server response.
    Q = generatorG1()
    beta = pair(x,tTilde)

    # Recompute c'
    t1 = Q*u + p*c 
    t2 = beta**u * y**c

    t1.normalize()

    cPrime = hashZ(Q,p,beta,y,t1,t2)

    # Check computed @c' against server's value @c
    if cPrime == c:
        return True

    if errorOnFail:
        raise Exception("zero-knowledge proof failed verification.")
    else:
        return False
217176
def sighash_for_witness(index, script_pubkey_or_script_code, hash_type, amount, skip_separator_index)
      hash_prevouts = Bitcoin.double_sha256(inputs.map{|i|i.out_point.to_payload}.join)
      hash_sequence = Bitcoin.double_sha256(inputs.map{|i|[i.sequence].pack('V')}.join)
      outpoint = inputs[index].out_point.to_payload
      amount = [amount].pack('Q')
      nsequence = [inputs[index].sequence].pack('V')
      hash_outputs = Bitcoin.double_sha256(outputs.map{|o|o.to_payload}.join)

      script_code = script_pubkey_or_script_code.to_script_code(skip_separator_index)

      case (hash_type & 0x1f)
      when SIGHASH_TYPE[:single]
        hash_outputs = index >= outputs.size ? "\x00".ljust(32, "\x00") : Bitcoin.double_sha256(outputs[index].to_payload)
        hash_sequence = "\x00".ljust(32, "\x00")
      when SIGHASH_TYPE[:none]
        hash_sequence = hash_outputs = "\x00".ljust(32, "\x00")
      end

      if (hash_type & SIGHASH_TYPE[:anyonecanpay]) != 0
        hash_prevouts = hash_sequence ="\x00".ljust(32, "\x00")
      end
      hash_type |= (Bitcoin.chain_params.fork_id << 8) if Bitcoin.chain_params.fork_chain?
      buf = [ [version].pack('V'), hash_prevouts, hash_sequence, outpoint,
              script_code ,amount, nsequence, hash_outputs, [@lock_time, hash_type].pack('VV')].join
      Bitcoin.double_sha256(buf)
    end
711092
def scalarmult_B(e):
    
    # scalarmult(B, l) is the identity
    e %= L
    P = IDENT
    for i in range(253):
        if e & 1:
            P = edwards_add(P=P, Q=Bpow[i])
        e //= 2
    assert e == 0, e
    return P
291661
def scrypt(password, salt='', n=2**20, r=8, p=1,
           maxmem=2**25, dklen=64):
    
    return nacl.bindings.crypto_pwhash_scryptsalsa208sha256_ll(
        password, salt, n, r, p, maxmem=maxmem, dklen=dklen)
562356
def secp256k1():
        
        GFp = FiniteField(2 ** 256 - 2 ** 32 - 977)  # This is P from below... aka FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
        ec = EllipticCurve(GFp, 0, 7)
        return ECDSA(ec, ec.point(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798, 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8), 2 ** 256 - 432420386565659656852420866394968145599)
270653
def verify2(self):
        
        output_key = hkdf_expand('MediaRemote-Salt',
                                 'MediaRemote-Write-Encryption-Key',
                                 self._shared)

        input_key = hkdf_expand('MediaRemote-Salt',
                                'MediaRemote-Read-Encryption-Key',
                                self._shared)

        log_binary(_LOGGER, 'Keys', Output=output_key, Input=input_key)
        return output_key, input_key
1149058
def main(argv: list) -> int:
    """"""
    passphrase = Passphrase()

    # Set defaults
    passphrase.entropy_bits_req = ENTROPY_BITS_MIN
    passwordlen_default = passphrase.password_length_needed()
    amount_n_default = 0
    passphrase.amount_n = amount_n_default
    # To avoid loading the wordlist unnecessarily, I'm hardcoding this value
    # It's ok, it's only used to show help information
    amount_w_default = 6

    parser = ArgumentParser(
        formatter_class=RawDescriptionHelpFormatter,
        description='{version_string}\n\n'
        'Generates a cryptographically secure passphrase, based on '
        'a wordlist, or a\npassword, and prints it to standard output.\n'
        'By default, it uses an embedded EFF Large Wordlist for passphrases.\n'
        'Passphrases with less than {wordsamountmin} words are considered '
        'insecure. A safe bet is \nbetween {wordsamountmin} and 7 words, '
        'plus at least a number.\n'
        'For passwords, use at least {passwdmin} characters, but prefer '
        '{passwdpref} or more, using the\ncomplete characters set.\n\n'
        'Instead of words and numbers, a password (random string of '
        'printable\ncharacters from Python String standard) can be generated '
        'by\n-p | --password, specifying the length. It uses uppercase, '
        'lowercase, digits\nand punctuation characters unless otherwise '
        'specified.\n'
        'Also, a UUID v4 string can be generated by --uuid4 or a coin can be '
        'thrown\nwith --coin.\n'
        'A custom wordlist can be specified by -i | --input, the format must '
        'be: \nsingle column, one word per line. If -d | --diceware is used, '
        'the input\nfile is treated as a diceware wordlist (two columns).'
        '\nOptionally, -o | --output can be used to specify an output file '
        '(existing \nfile is overwritten).\n'
        'The number of words is {wordsamountmin} by default, but it '
        'can be changed by -w | --words.\n'
        'The number of numbers is {numsamountmin} by default, but it can be '
        'changed by\n-n | --numbers. The generated numbers are between '
        '{minnum} and {maxnum}.\n'
        'The default separator is a blank space, but any character or '
        'character\nsequence can be specified by -s | --separator.\n'
        '\nExample output:\n'
        '\tDefault parameters:\tchalice sheath postcard modular cider size\n'
        '\tWords=3, Numbers=2:\tdepraved widow office 184022 320264\n'
        '\tPassword, 20 chars:\tsF#s@B+iR#ZIL-yUWKPR'.format(
            version_string=__version_string__,
            minnum=passphrase.randnum_min,
            maxnum=passphrase.randnum_max,
            wordsamountmin=amount_w_default,
            numsamountmin=amount_n_default,
            passwdmin=passwordlen_default,
            passwdpref=passwordlen_default + 4
        )
    )

    parser.add_argument(
        '--version',
        action='store_true',
        help='print program version and licensing information and exit'
    )
    parser.add_argument(
        '--insecure',
        action='store_true',
        default=False,
        help="force password/passphrase generation even if the system's "
             "entropy is too low"
    )
    parser.add_argument(
        '--no-newline',
        action='store_true',
        default=False,
        help="don't print newline at the end of the passphrase/password"
    )
    parser.add_argument(
        '-m',
        '--mute',
        action='store_true',
        default=False,
        help="muted mode: it won't print output, only informational, warning "
             "or error messages (usefull with -o | --output)"
    )
    parser.add_argument(
        '-v',
        '--verbose',
        action='store_true',
        default=False,
        help='print additional information (can coexist with -m | --mute)'
    )
    parser.add_argument(
        '-e',
        '--entropybits',
        type=_bigger_than_zero,
        default=ENTROPY_BITS_MIN,
        help='specify the number of bits to use for entropy calculations '
             '(defaults to {})'.format(ENTROPY_BITS_MIN)
    )
    parser.add_argument(
        '--uuid4',
        action='store_true',
        default=False,
        help='generate an UUID v4 string'
    )
    parser.add_argument(
        '--coin',
        action='store_true',
        default=False,
        help='generate a random coin throw: heads or tails'
    )
    parser.add_argument(
        '-p',
        '--password',
        type=_bigger_than_zero,
        const=-1,
        nargs='?',
        help='generate a password of the specified length from all printable '
             'or selected characters'
    )
    parser.add_argument(
        '--use-uppercase',
        type=_bigger_than_zero,
        const=0,
        nargs='?',
        help='use uppercase characters for password generation or give the '
             'amount of uppercase characters in the passphrase: zero or no '
             'input for all uppercase or any number of uppercase '
             'characters wanted (the rest are lowercase)'
    )
    parser.add_argument(
        '--use-lowercase',
        type=_bigger_than_zero,
        const=0,
        nargs='?',
        help='use lowercase characters for password generation or give the '
             'amount of lowercase characters in the passphrase: zero or no '
             'input for all lowercase (default) or any number of lowercase '
             'characters wanted (the rest are uppercase)'
    )
    parser.add_argument(
        '--use-digits',
        action='store_true',
        default=False,
        help='use digits for password generation'
    )
    parser.add_argument(
        '--use-alphanumeric',
        action='store_true',
        default=False,
        help='use lowercase and uppercase characters, and digits for password '
             'generation (equivalent to --use-lowercase --use-uppercase '
             '--use-digits)'
    )
    parser.add_argument(
        '--use-punctuation',
        action='store_true',
        default=False,
        help='use punctuation characters for password generation'
    )
    parser.add_argument(
        '-w',
        '--words',
        type=_bigger_than_zero,
        help='specify the amount of words (0 or more)'
    )
    parser.add_argument(
        '-n',
        '--numbers',
        type=_bigger_than_zero,
        default=amount_n_default,
        help='specify the amount of numbers (0 or more)'
    )
    parser.add_argument(
        '-s',
        '--separator',
        type=str,
        default=' ',
        help='specify a separator character (space by default)'
    )
    parser.add_argument(
        '-o',
        '--output',
        type=str,
        help='specify an output file (existing file is overwritten)'
    )
    parser.add_argument(
        '-i',
        '--input',
        type=str,
        help='specify an input file (it must have the following format: '
             'single column, one word per line)'
    )
    parser.add_argument(
        '-d',
        '--diceware',
        action='store_true',
        default=False,
        help='specify input file as a diceware list (format: two colums)'
    )

    args = parser.parse_args(argv)

    inputfile = args.input
    outputfile = args.output
    separator = args.separator
    is_diceware = args.diceware
    passwordlen = args.password
    amount_w = args.words
    amount_n = args.numbers
    show_version = args.version
    mute = args.mute
    verbose = args.verbose
    no_newline = args.no_newline
    gen_uuid4 = args.uuid4
    gen_coin = args.coin
    p_uppercase = args.use_uppercase
    p_lowercase = args.use_lowercase
    p_digits = args.use_digits
    p_punctuation = args.use_punctuation
    p_alphanumeric = args.use_alphanumeric
    entropy_bits = args.entropybits
    gen_insecure = args.insecure

    if show_version:
        print(__version_string__)
        return 0

    if verbose:
        Aux.print_stderr(__version_string__)

    # Check system entropy
    system_entropy = Aux.system_entropy()
    if system_entropy < SYSTEM_ENTROPY_BITS_MIN:
        Aux.print_stderr(
            'Warning: the system has too few entropy: {} bits; randomness '
            'quality could be poor'.format(system_entropy)
        )
        if not gen_insecure:
            Aux.print_stderr(
                'Error: system entropy too low: {system_entropy} '
                '< {system_entropy_min}'.format(
                    system_entropy=system_entropy,
                    system_entropy_min=SYSTEM_ENTROPY_BITS_MIN
                )
            )
            return 1

    if verbose:
        Aux.print_stderr(
            'Using {} bits of entropy for calculations (if any). The minimum '
            'recommended is {}'.format(entropy_bits, ENTROPY_BITS_MIN)
        )

    # Check selected entropy
    check_chosen_entropy = False if gen_uuid4 or gen_coin else not (
        amount_n and amount_w and passwordlen is None
    )
    if check_chosen_entropy and entropy_bits < ENTROPY_BITS_MIN:
        Aux.print_stderr(
            'Warning: insecure number of bits for entropy calculations '
            'chosen! Should be bigger than {}'.format(ENTROPY_BITS_MIN)
        )
    passphrase.entropy_bits_req = entropy_bits

    # Generate whatever is requested
    if gen_uuid4:
        # Generate uuid4
        if verbose:
            Aux.print_stderr('Generating UUID v4')
        gen_what = 'UUID v4'
        gen_ent = 120

        passphrase.generate_uuid4()
        passphrase.separator = '-'
    elif gen_coin:
        # Generate a coin throw
        if verbose:
            Aux.print_stderr('Throwing a coin')
        gen_what = 'coin'
        gen_ent = 1

        passphrase = 'Heads' if randbool() else 'Tails'
    elif passwordlen is not None:
        # Generate a password
        gen_what = 'password'

        p_uppercase = True if p_uppercase is not None else False
        p_lowercase = True if p_lowercase is not None else False
        if (
                p_uppercase
                or p_lowercase
                or p_digits
                or p_punctuation
                or p_alphanumeric
        ):
            passphrase.password_use_uppercase = (p_uppercase or p_alphanumeric)
            passphrase.password_use_lowercase = (p_lowercase or p_alphanumeric)
            passphrase.password_use_digits = (p_digits or p_alphanumeric)
            passphrase.password_use_punctuation = p_punctuation

        min_len = passphrase.password_length_needed()
        if passwordlen < 1:
            passwordlen = min_len
        elif passwordlen < min_len:
            Aux.print_stderr(
                'Warning: insecure password length chosen! Should be bigger '
                'than or equal to {}'.format(min_len)
            )

        passphrase.passwordlen = passwordlen
        gen_ent = passphrase.generated_password_entropy()

        if verbose:
            verbose_string = (
                'Generating password of {} characters long '
                'using '.format(passwordlen)
            )
            verbose_string += (
                'uppercase characters, ' if (
                    passphrase.password_use_uppercase or p_alphanumeric
                ) else ''
            )
            verbose_string += (
                'lowercase characters, ' if (
                    passphrase.password_use_lowercase or p_alphanumeric
                ) else ''
            )
            verbose_string += (
                'digits, ' if (
                    passphrase.password_use_digits or p_alphanumeric
                ) else ''
            )
            verbose_string += (
                'punctuation characters, ' if (
                    passphrase.password_use_punctuation
                ) else ''
            )
            Aux.print_stderr(
                verbose_string[:-2] if (
                    verbose_string[-2:] == ', '
                ) else verbose_string
            )

        passphrase.generate_password()
        passphrase.separator = ''
    else:
        # Generate a passphrase
        gen_what = 'passphrase'

        # Read wordlist if indicated
        if inputfile is None:
            passphrase.load_internal_wordlist()
        else:
            try:
                passphrase.import_words_from_file(inputfile, is_diceware)
            except IOError:
                Aux.print_stderr(
                    "Error: input file {} is empty or it can't be opened or "
                    "read".format(inputfile)
                )
                return 1

        passphrase.amount_n = amount_n
        amount_w_good = passphrase.words_amount_needed()
        if amount_w is None:
            amount_w = amount_w_good
        elif amount_w < amount_w_good:
            Aux.print_stderr(
                'Warning: insecure amount of words chosen! Should be '
                'bigger than or equal to {}'.format(amount_w_good)
            )

        passphrase.amount_w = amount_w
        gen_ent = passphrase.generated_passphrase_entropy()

        if verbose:
            Aux.print_stderr(
                'Generating a passphrase of {} words and {} '
                'numbers using {}'.format(
                    amount_w,
                    amount_n,
                    'internal wordlist' if inputfile is None else (
                        'external wordlist: ' + inputfile + (
                            ' (diceware-like)' if is_diceware else ''
                        )
                    )
                )
            )

        case = (-1 * p_lowercase) if p_lowercase else p_uppercase
        passphrase.generate(case)
        passphrase.separator = separator

    if verbose:
        Aux.print_stderr(
            'The entropy of this {what} is {ent:.2f} bits'.format(
                what=gen_what,
                ent=gen_ent
            )
        )

    if not gen_coin and gen_ent < ENTROPY_BITS_MIN:
        Aux.print_stderr('Warning: the {} is too short!'.format(gen_what))

    if not mute:
        if no_newline:
            print(passphrase, end='')
        else:
            print(passphrase)

    if outputfile is not None:
        # ensure path to file exists or create
        dir_ = os_path_dirname(outputfile)
        if dir_:
            try:
                os_makedirs(dir_, exist_ok=True)
            except PermissionError:
                Aux.print_stderr(
                    'Error: permission denied to create directory {}'.format(
                        dir_,
                    )
                )
                return 1
        try:
            with open(outputfile, mode='wt', encoding='utf-8') as outfile:
                linefeed = '' if no_newline else '\n'
                outfile.write(str(passphrase) + linefeed)

        except IOError:
            Aux.print_stderr(
                "Error: file {} can't be opened or written".format(
                    outputfile,
                )
            )
            return 1

    return 0
484189
def sign(self, message, privkey, secret):
        
        m = self.GFn.value(message)
        x = self.GFn.value(privkey)
        k = self.GFn.value(secret)

        R = self.G * k

        r = self.GFn.value(R.x)
        s = (m + x * r) / k

        return (r, s)
987488
public static int cusolverSpScsrlsvqr(
        cusolverSpHandle handle, 
        int m, 
        int nnz, 
        cusparseMatDescr descrA, 
        Pointer csrVal, 
        Pointer csrRowPtr, 
        Pointer csrColInd, 
        Pointer b, 
        float tol, 
        int reorder, 
        Pointer x, 
        int[] singularity)
    {
        return checkResult(cusolverSpScsrlsvqrNative(handle, m, nnz, descrA, csrVal, csrRowPtr, csrColInd, b, tol, reorder, x, singularity));
    }
542841
def encrypt(pubkey, password):
    
    key = load_key(pubkey)
    encrypted_password = key.encrypt(password, PKCS1v15())
    return base64.b64encode(encrypted_password)
956605
def isqrt(n):
    ''' 
    '''
    # TODO: replace with a more efficient implementation

    if n == 0:
        return n, 1
    if n < 0:
        raise ValueError('math domain error')

    a, b, c = 1, n, 1

    def divisors():
        yield 2
        yield 3
        k = 5
        while k * k <= b:
            yield k
            k += 2
            yield k
            k += 4
            
    for k in divisors():
        d, m = divmod(b, k * k)
        while m == 0:
            a *= k
            b = d
            d, m = divmod(b, k * k)
        if b % k == 0:
            b //= k
            c *= k

        k += 1
    return a, b*c