Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to make a hexadecimal number into a string

I generate a hexadecimal number 0xffffffffffffffffffffffffffffffff like

s=0

for i in range(128):

s=s+2^i

s=hex(s)

I want to make it string like 'ffffffffffffffffffffffffffffffff' so that I can pass it as follows:

from sage.crypto.mq.rijndael_gf import RijndaelGF

rgf = RijndaelGF(4, 4)

state = rgf._hex_to_GF('ffffffffffffffffffffffffffffffff')