def decrypt(encrypted_privkey, passphrase):
d = unhexlify(base58decode(encrypted_privkey))<EOL>d = d[<NUM_LIT:2>:]  <EOL>flagbyte = d[<NUM_LIT:0>:<NUM_LIT:1>]  <EOL>d = d[<NUM_LIT:1>:]  <EOL>assert flagbyte == b"<STR_LIT>", "<STR_LIT>"<EOL>salt = d[<NUM_LIT:0>:<NUM_LIT:4>]<EOL>d = d[<NUM_LIT:4>:-<NUM_LIT:4>]<EOL>if SCRYPT_MODULE == "<STR_LIT>":  <EOL><INDENT>key = scrypt.hash(passphrase, salt, <NUM_LIT>, <NUM_LIT:8>, <NUM_LIT:8>)<EOL><DEDENT>elif SCRYPT_MODULE == "<STR_LIT>":  <EOL><INDENT>key = scrypt.scrypt(bytes(passphrase, "<STR_LIT:utf-8>"), salt, <NUM_LIT>, <NUM_LIT:8>, <NUM_LIT:8>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")  <EOL><DEDENT>derivedhalf1 = key[<NUM_LIT:0>:<NUM_LIT:32>]<EOL>derivedhalf2 = key[<NUM_LIT:32>:<NUM_LIT:64>]<EOL>encryptedhalf1 = d[<NUM_LIT:0>:<NUM_LIT:16>]<EOL>encryptedhalf2 = d[<NUM_LIT:16>:<NUM_LIT:32>]<EOL>aes = AES.new(derivedhalf2, AES.MODE_ECB)<EOL>decryptedhalf2 = aes.decrypt(encryptedhalf2)<EOL>decryptedhalf1 = aes.decrypt(encryptedhalf1)<EOL>privraw = decryptedhalf1 + decryptedhalf2<EOL>privraw = "<STR_LIT>" % (int(hexlify(privraw), <NUM_LIT:16>) ^ int(hexlify(derivedhalf1), <NUM_LIT:16>))<EOL>wif = Base58(privraw)<EOL>"""<STR_LIT>"""<EOL>privkey = PrivateKey(format(wif, "<STR_LIT>"))<EOL>addr = format(privkey.bitcoin.address, "<STR_LIT>")<EOL>a = _bytes(addr)<EOL>saltverify = hashlib.sha256(hashlib.sha256(a).digest()).digest()[<NUM_LIT:0>:<NUM_LIT:4>]<EOL>if saltverify != salt:  <EOL><INDENT>raise SaltException("<STR_LIT>")<EOL><DEDENT>return wif<EOL>
BIP0038 non-ec-multiply decryption. Returns WIF privkey.

    :param Base58 encrypted_privkey: Private key
    :param str passphrase: UTF-8 encoded passphrase for decryption
    :return: BIP0038 non-ec-multiply decrypted key
    :rtype: Base58
    :raises SaltException: if checksum verification failed (e.g. wrong
        password)