Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I need to solve this task but I cannot please help me.

THE VARIABLE foundedThatUnknownInteger must be calculated and after that printed in here it must show mustFoundThisUnknownInteger but not simple printing but after calculating that number very very fast/quickly

Python
from tinyec.ec import SubGroup, Curve
from tqdm import tqdm

# List parameters for ecdsa Curve
name = 'secp256k1'
p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
a = 0x0000000000000000000000000000000000000000000000000000000000000000
b = 0x0000000000000000000000000000000000000000000000000000000000000007
g = (0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798, 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8)
h = 1

mustFoundThisUnknownInteger = 100000000000000000000000000000000000000000000000000000000009999999999999

# Must be done these examples too and calculated after that printed not simple print but after Calculation

# mustFoundThisUnknownInteger = 2000000000000000000000000000000000000000000000000078985
# mustFoundThisUnknownInteger = 6018167063539008028669445313231960090404259176608743629709772251
# mustFoundThisUnknownInteger = 7092948589338195099895057009523581222533689142462272932711328439
# mustFoundThisUnknownInteger = 3011962151712017560871622225065333291020510624333748036330920274

curve = Curve(a, b, SubGroup(p, g, n, h), name)
pubKey = curve.g * mustFoundThisUnknownInteger

# Create 16 powers of 65536

numList = []
numList.append(pubKey)

for bytePosition in range(15):
    for bitPosition in range(16):
        place = pubKey + pubKey
        pubKey = place
    numList.append(place)
    pubKey = pubKey

tupleNumList = tuple(numList)

finalList = []

for tupNum in tqdm(tupleNumList, ascii=True, ncols=100, colour='#00ff00', unit='Columns', desc='Rows'):
    subList = []
    zero = 0
    subList.append(zero)
    position1 = tupNum
    subList.append(position1)

    for iteration in range(65534):
        position2 = position1 + tupNum
        subList.append(position2)
        position1 = position2

    finalList.append(subList)   

grid = tuple(finalList)

##Define Multiply Function
def multiplyNum(number):
    foundedThatUnknownInteger = None

    N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
    
    ##Read in the integer input as big endian hex 4 hex digits at a time
    array = ((number)%N).to_bytes(32, "big")
    counter = 0
    hexLists = []
    posList = []

    for count in range(16):
        element = (hex(array[counter])[2:])+(hex(array[counter+1])[2:])
        hexLists.append(element)
        counter += 2
    
    ##Then Reverse the "words" to be looked up
    ## Then using the grid above...lookup each "hex Word""
    hexLists.reverse()
    tupleHexList = tuple(hexLists)
    
    for itered, product in enumerate(tupleHexList):
        position = (grid[itered][(int(product, 16))])

        ##Each position is looked up according to its index, and each "hex word" is converted to an integer to give its index
        if position == 0:
            pass
        else:
            posList.append(position)

        tuplePos = tuple(posList)
    
    ##The positions are added to a list to be added together accounting for zeros along the way    
    if len(tuplePos) < 1:
        print("Infinity and Beyond")
    else:
        total = tuplePos[0]

        if len(tuplePos) < 2:
            print(total)            
        else:
            for k in tuplePos[1:]:
                total = total + k

            print(total)


    ## PLEASE READ CAREFULLY HERE MUST BE FOUND/CALCULATE AND PRINT NUMBER OF   mustFoundThisUnknownInteger  NUMBER, YOU MUST CALCULATE THAT NUMBER AND PRINT HERE NOT JUST PRINT THE VARIABLE mustFoundThisUnknownInteger

    ## THE VARIABLE   foundedThatUnknownInteger   must be calculated and after that printed in here it must show   mustFoundThisUnknownInteger  but not simple printing but after calculating that number very very fast/quickly


##The result is exactly the same as any binary addition but this acheives the same result using a maximum of 15 additions per operation
##Where 256 bit binary addition takes 255 addition steps maximum...so this is an exact 17 X speed increase per operation
multiplyNum(115792089237316195423570985008687907852837564279074904382605163141518161494336)
multiplyNum(1)


What I have tried:

THE VARIABLE foundedThatUnknownInteger must be calculated and after that printed in here it must show mustFoundThisUnknownInteger but not simple printing but after calculating that number very very fast/quickly
Posted
Updated 2-Jul-23 19:38pm
Comments
Richard MacCutchan 3-Jul-23 4:10am    
"THE VARIABLE foundedThatUnknownInteger must be calculated"
But you have not explained the rules of how to calculate the answer, i.e. what inputs are used and how they should be manipulated.

1 solution

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
Comments
K. Khurshudyan 3-Jul-23 1:39am    
Yes I will pay if you can solve this
OriginalGriff 3-Jul-23 2:07am    
No, we are not a "code to order" site.
K. Khurshudyan 3-Jul-23 1:41am    
I tried to code some times but it would unsuccessful, I paste the code and explained what I need.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900