Partially answer this question after 7 years, if someone needs it.
You can use ROR / ROL in .Net.
MSIL does not directly contain ROR or ROL operations, but there are patterns that will cause the JIT compiler to generate ROR and ROL. RuyJIT (.Net and .Net kernel) supports this.
Details of the .Net Core enhancement for using this template were discussed here and a month later .Net Core code was updated to use it .
Looking at the implementation of SHA512 , we find examples of ROR:
public static UInt64 RotateRight(UInt64 x, int n) { return (((x) >> (n)) | ((x) << (64-(n)))); }
And expands one pattern for ROL:
public static UInt64 RotateLeft(UInt64 x, int n) { return (((x) << (n)) | ((x) >> (64-(n)))); }
To do this on a 128-bit integer, you can process as two 64-bit, then AND to extract the βcarryβ, AND to clear the destination, and OR to apply. This should be reflected in both directions (low β high and high - low). I am not going to worry about the example because this question is a bit outdated.
source share