This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # public domain/creative commons 0, use at your own risk | |
| from typing import List | |
| import traceback | |
| from decimal import Decimal | |
| # Please note that this script will have some amount of negative privacy impact. | |
| from monero.wallet import Wallet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| forward_mimc: (input_data, steps) => { | |
| const encoder = new TextEncoder(); | |
| const decoder = new TextDecoder(); | |
| const inputBytes = encoder.encode(input_data); | |
| let inp = BigInt('0x' + Array.from(inputBytes, byte => byte.toString(16).padStart(2, '0')).join('')); | |
| for (let i = 1n; i < BigInt(steps); i++) { | |
| inp = (inp ** 3n + _round_constants[Number(i % BigInt(_round_constants.length))]) % _modulus; | |
| } |