^ is a bitwise xor operator. For example, a ^ b will toggle in 'a' any bits set in 'b'.

% is the modulus operator. a % b returns the remainder of dividing 'a' by 'b'.

? selects between two expressions. (a ? b : c) means "if a is true (nonzero), the value of the expression is b, otherwise (a is false or zero), the value of the expression is c.

I don't know VB.net, but this should get you close enough:

// pseudo basic conversion of "next_A1 = next_A1 ^ D ^ ((j % 2) ? in2 : in1);"

tmp = next_A1

// The following evaluates "next_A1 ^ D"

tmp = result XOR D

// The following evaluates "j % 2"

tmp2 = j MOD 2

// The following evaluates ((j % 2) ? in2 : in1)

if tmp2 <> 0

tmp3 = in2

else

tmp3 = in1

endif

// The following does the final xor

result = result XOR tmp3

next_A1 = result

--------------------------------------

Here is a more compact way:

if (j MOD 2) <> 0

next_A1 = next_A1 XOR D XOR in2

else

next_A1 = next_A1 XOR D XOR in1

endif

% is the modulus operator. a % b returns the remainder of dividing 'a' by 'b'.

? selects between two expressions. (a ? b : c) means "if a is true (nonzero), the value of the expression is b, otherwise (a is false or zero), the value of the expression is c.

I don't know VB.net, but this should get you close enough:

// pseudo basic conversion of "next_A1 = next_A1 ^ D ^ ((j % 2) ? in2 : in1);"

tmp = next_A1

// The following evaluates "next_A1 ^ D"

tmp = result XOR D

// The following evaluates "j % 2"

tmp2 = j MOD 2

// The following evaluates ((j % 2) ? in2 : in1)

if tmp2 <> 0

tmp3 = in2

else

tmp3 = in1

endif

// The following does the final xor

result = result XOR tmp3

next_A1 = result

--------------------------

Here is a more compact way:

if (j MOD 2) <> 0

next_A1 = next_A1 XOR D XOR in2

else

next_A1 = next_A1 XOR D XOR in1

endif