As I understand it, your code takes A and B as input and returns the result in R on the right? Well, as you encoded it, it wonβt work. You pass R as a parameter to the scope of the multiplication function. This means that after the function returns, all the memory used by this function will be freed and R will be cleared. You also use the parameter transfer parameter, which in C # makes a copy of the original parameter for use in the function and does not change the original variable.
, , :
public static int multiplication(byte[] A, byte[] B, ref byte[] R)
{
...
, :
public static byte[] multiplication(byte[] A, byte[] B)
{
byte[] R;
return R;
}