Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assigning variable values in a program

For a cryptography application, I want to assigned values of 0 or 1 to the following variables (x0, x1, x2, ..., x128). I want to define a function to take a hexadecimal representation of the 128 bits and assigned a 0 or 1 to each variable.

This can easily be done manually in sage by simply stating:
sage: x0 = 0
sage: x1 = 1 # and so on.

But I'm having finding a way to include this type of variable assignment in a function. I can do it by writting to a file and loading the file in Sage, but that required manual intervention to load the file.

Sorry if this is a trivial question, but I couldn't find an answer in the documentation

Thanks!