i am doing encryption and decryption and my algorithm inputs sizes is 256 bits. in test bench i am getting an error like "555677895559 exceeds maximum integer value ", although i didn't declare it as an integer.
constant P: std_logic_vector(255 downto 0):=x"2523648240000001ba344d80000000086121000000000013a700000000000013";
i declare P as constant and perform A+B mod P and A-B mod P based on Cin. any suggestion or comment from your's side?
i am doing encryption and decryption and my algorithm inputs sizes is 256 bits. in test bench i am getting an error like "555677895559 exceeds maximum integer value ", although i didn't declare it as an integer.
constant P: std_logic_vector(255 downto 0):=x"2523648240000001ba344d80000000086121000000000013a700000000000013";
i declare P as constant and perform A+B mod P and A-B mod P based on Cin. any suggestion or comment from your's side?
Using VHDL integers breaks down at 32 bits, since you need something larger you should be using 'signed' and 'unsigned' types from the ieee.numeric_std library. Vector length of these types is virtually unlimited (i.e. you can have on the approximately 2^32 bits in the vector as opposed to just 32 bits that represents integers).
i am doing encryption and decryption and my algorithm inputs sizes is 256 bits. in test bench i am getting an error like "555677895559 exceeds maximum integer value ", although i didn't declare it as an integer.
Using VHDL integers breaks down at 32 bits, since you need something larger you should be using 'signed' and 'unsigned' types from the ieee.numeric_std library. Vector length of these types is virtually unlimited (i.e. you can have on the approximately 2^32 bits in the vector as opposed to just 32 bits that represents integers).
yes i am using unsigned types from ieee.numeric_std library. in test bench i used a conversion function to convert decimal into binary like
"a<= conv_std_logic_vector (1157777,256)", i think the problem could be here i need your suggestion.
well for a start, conv_std_logic_vector is not in the numeric_std library, so you must be using a non-standard library.
Second, you cannot convert integers to large arrays like that. You'll have to do it in 32 bit chunks and concatenate them or slice the ranges: