Bitcoin Forum
May 03, 2024, 10:44:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to get in Python, result same in cpp ?  (Read 160 times)
COBRAS (OP)
Member
**
Offline Offline

Activity: 847
Merit: 22

$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk


View Profile
May 10, 2022, 04:16:27 PM
 #1

Hello

Then I divide in modmath I get:

./modmath  0x60f4d11574f5deee49961d9609ac / 2                                 

Result: 307a688aba7aef7724cb0ecb04d6

in Python:

He =0x60f4d11574f5deee49961d9609ac

h2 = int(He / 2) % n

print(hex(h2))

result

0x307a688aba7af000000000000000

[Program finished]



HOW TO GET IN PYTHON result = af55fc59c335c8ec67ed24827 ?
------


/modmath 0x60f4d11574f5deee49961d9609ac / 8                                 

 Result: 7fffffffffffffffffffffffffffffff5d577a91f1c6febc9bc6f8792bcde1d6

python:

n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141



He =0x60f4d11574f5deee49961d9609ac

h2 = int(He / 8 ) % n

print(hex(h2))


0xc1e9a22ae9ebc00000000000000

[Program finished

HOW TO GET IN PYTHON result = 7fffffffffffffffffffffffffffffff5d577a91f1c6febc9bc6f8792bcde1d6 Huh

thanks !!!

ASAP PLEASE

$$$ P2P NETWORK FOR BTC WALLET.DAT BRUTE F ORCE .JOIN NOW=GET MANY COINS NOW !!!
https://github.com/phrutis/LostWallet  https://t.me/+2niP9bQ8uu43MDg6
1714776260
Hero Member
*
Offline Offline

Posts: 1714776260

View Profile Personal Message (Offline)

Ignore
1714776260
Reply with quote  #2

1714776260
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714776260
Hero Member
*
Offline Offline

Posts: 1714776260

View Profile Personal Message (Offline)

Ignore
1714776260
Reply with quote  #2

1714776260
Report to moderator
1714776260
Hero Member
*
Offline Offline

Posts: 1714776260

View Profile Personal Message (Offline)

Ignore
1714776260
Reply with quote  #2

1714776260
Report to moderator
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5818


not your keys, not your coins!


View Profile WWW
May 10, 2022, 07:55:46 PM
 #2

This happens because the division operator gives you a float which can only have so many bits of accuracy. You circumvent it by using //.

Example:
Code:
>>> 1966507701910865760267104647776684/2
9.832538509554329e+32
>>> hex(int(1966507701910865760267104647776684/2))
'0x307a688aba7af000000000000000'

As you correctly noticed, all those trailing zeroes are wrong and due to the rounding done by Python floats.

By dividing with //, you force it to stay in the integer realm and you get the correct result.
Code:
>>> 1966507701910865760267104647776684//2
983253850955432880133552323888342
>>> hex(int(1966507701910865760267104647776684//2))
'0x307a688aba7aef7724cb0ecb04d6'

The second division is mathematically wrong (the modmath output, that is), it seems to have overflown. I don't know how many bits a modmath number has, so I can't tell you how to replicate the result in Python. But the method from above (with double //) will give you mathematically correct results no matter what.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6727


bitcoincleanup.com / bitmixlist.org


View Profile WWW
May 11, 2022, 04:09:27 AM
 #3

./modmath  0x60f4d11574f5deee49961d9609ac / 2                                 
...
h2 = int(He / 2) % n
...
HOW TO GET IN PYTHON result = af55fc59c335c8ec67ed24827 ?

[I have trimmed your code and cmdline above]

Apparently, the first line is for a c++ program (did you write it?), the other is for a custom script that you made.

If you did not write the modmath program then you ought to take a look at its code on Github to see how it's getting the correct results. Maybe there are some ANDs being done there which you thought weren't necessary in Python because of its lack of overflow. (and while you're at the codebase, drop us a link to it please).

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
iceland2k14
Jr. Member
*
Offline Offline

Activity: 31
Merit: 52


View Profile
May 11, 2022, 04:51:27 AM
 #4

If you did not write the modmath program then you ought to take a look at its code on Github to see how it's getting the correct results. Maybe there are some ANDs being done there which you thought weren't necessary in Python because of its lack of overflow. (and while you're at the codebase, drop us a link to it please).

He is Talking about https://github.com/albertobsd/ecctools  I think.
mausuv
Jr. Member
*
Offline Offline

Activity: 70
Merit: 1


View Profile
May 11, 2022, 06:12:11 AM
Last edit: May 11, 2022, 06:25:38 AM by mausuv
 #5

Hello

Then I divide in modmath I get:

./modmath  0x60f4d11574f5deee49961d9609ac / 2                                  

Result: 307a688aba7aef7724cb0ecb04d6

@COBRAS
you need this ( 0x60f4d11574f5deee49961d9609ac / 2 =  307a688aba7aef7724cb0ecb04d6) result run python2, its working
Code:
user@0d3aad1851b1:~/Downloads$ python2 1.py
0x307a688aba7aef7724cb0ecb04d6L
you need this ( 0x60f4d11574f5deee49961d9609ac /8 = 7fffffffffffffffffffffffffffffff5d577a91f1c6febc9bc6f8792bcde1d6) result , wrong
Code:
user@0d3aad1851b1:~/Downloads$ python2 1.py
0xc1e9a22ae9ebbddc932c3b2c135L
your need python from ./modmath   Roll Eyes #its easy but some result wrong output print

edit:
@COBRAS share your ./modemath ideas thinkeasy123@protonmail.com
answer me https://bitcointalk.org/index.php?topic=5395858.msg60039035#msg60039035
fxsniper
Member
**
Offline Offline

Activity: 406
Merit: 45


View Profile
May 11, 2022, 07:54:20 AM
 #6

I think modmath.c it is not a division number by simple math
but modmath.c it is division by use function Elliptic curve  point division


Code:
		case '/':
mpz_invert(inversemultiplier,B,EC.n);
mpz_mul(C,A,inversemultiplier);
mpz_mod(C,C,EC.n);

Code:
def ECdiv(Qx,Qy,Scalar): # EC point division
    A = (N-1)/Scalar
    Px,Py = ECmul(Qx,Qy,A)
    Py = P-Py
    return Px,Py

try to use Elliptic curve  point division function on python
I am not sure I am correct, wait programmer/expert coder to help confirm
COBRAS (OP)
Member
**
Offline Offline

Activity: 847
Merit: 22

$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk


View Profile
May 11, 2022, 01:32:21 PM
 #7

Hello

Then I divide in modmath I get:

./modmath  0x60f4d11574f5deee49961d9609ac / 2                                  

Result: 307a688aba7aef7724cb0ecb04d6

@COBRAS
you need this ( 0x60f4d11574f5deee49961d9609ac / 2 =  307a688aba7aef7724cb0ecb04d6) result run python2, its working
Code:
user@0d3aad1851b1:~/Downloads$ python2 1.py
0x307a688aba7aef7724cb0ecb04d6L
you need this ( 0x60f4d11574f5deee49961d9609ac /8 = 7fffffffffffffffffffffffffffffff5d577a91f1c6febc9bc6f8792bcde1d6) result , wrong
Code:
user@0d3aad1851b1:~/Downloads$ python2 1.py
0xc1e9a22ae9ebbddc932c3b2c135L
your need python from ./modmath   Roll Eyes #its easy but some result wrong output print

edit:
@COBRAS share your ./modemath ideas thinkeasy123@protonmail.com
answer me https://bitcointalk.org/index.php?topic=5395858.msg60039035#msg60039035

Hi Bro. Yes, I need this.

pm me we are talk.

I not agree what 0xfffff... is wrang. because then I div for ex 10 to 9 (10 / 9) 0xfff.......  is ok, result without floating part not good for dividing...

$$$ P2P NETWORK FOR BTC WALLET.DAT BRUTE F ORCE .JOIN NOW=GET MANY COINS NOW !!!
https://github.com/phrutis/LostWallet  https://t.me/+2niP9bQ8uu43MDg6
COBRAS (OP)
Member
**
Offline Offline

Activity: 847
Merit: 22

$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk


View Profile
May 11, 2022, 01:33:32 PM
 #8

If you did not write the modmath program then you ought to take a look at its code on Github to see how it's getting the correct results. Maybe there are some ANDs being done there which you thought weren't necessary in Python because of its lack of overflow. (and while you're at the codebase, drop us a link to it please).

He is Talking about https://github.com/albertobsd/ecctools  I think.

yes

$$$ P2P NETWORK FOR BTC WALLET.DAT BRUTE F ORCE .JOIN NOW=GET MANY COINS NOW !!!
https://github.com/phrutis/LostWallet  https://t.me/+2niP9bQ8uu43MDg6
COBRAS (OP)
Member
**
Offline Offline

Activity: 847
Merit: 22

$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk


View Profile
May 12, 2022, 04:08:59 PM
Last edit: May 12, 2022, 10:42:01 PM by COBRAS
 #9

example of dividing

./md 1 / 3             Result: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b81 (let it be 1/3)

10000 x 1/3:

./md 10000 x 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b81                                            Result: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0243886

1000*1/3 - 1/3=3333:

./md 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0243886 - 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b81                                 Result: d05

search range:

1/3 to 1/3*10000

0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b81

:

0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0243886

= 3333

3 times smale then 10000.You can play with ecctools for making your methods based on this example.


Use pubkeys from start privkeys and you get pubkey in range 3 time smaler too !!!


I looking for python programmer who know good simplest math operation in python for work on code for dividing pubksys.

ASAP.

YOU MAST KNOW HOW TO GET THIS RESULT, IF YOU CAN MESSAGE ME
 YOUR TELEGRAMM FOR TALK:

Hello

Then I divide in modmath I get:

./modmath  0x60f4d11574f5deee49961d9609ac / 2                                  

Result: 307a688aba7aef7724cb0ecb04d6

@COBRAS
you need this ( 0x60f4d11574f5deee49961d9609ac / 2 =  307a688aba7aef7724cb0ecb04d6) result run python2, its working
Code:
user@0d3aad1851b1:~/Downloads$ python2 1.py
0x307a688aba7aef7724cb0ecb04d6L
you need this ( 0x60f4d11574f5deee49961d9609ac /8 = 7fffffffffffffffffffffffffffffff5d577a91f1c6febc9bc6f8792bcde1d6) result , wrong
Code:
user@0d3aad1851b1:~/Downloads$ python2 1.py
0xc1e9a22ae9ebbddc932c3b2c135L
your need python from ./modmath   Roll Eyes #its easy but some result wrong output print

edit:








$$$ P2P NETWORK FOR BTC WALLET.DAT BRUTE F ORCE .JOIN NOW=GET MANY COINS NOW !!!
https://github.com/phrutis/LostWallet  https://t.me/+2niP9bQ8uu43MDg6
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!