mirror of
https://github.com/Geprivilegieerde-Anonimiteit-BV/XACrypto.git
synced 2026-08-21 13:36:21 -04:00
* add AES.java additions + Galois.java * desc used ECB and ECBExceptionless instead of seperate interfaces. AESECB done * Twofish ECB developments, moved some files * twofishecb done * Update Factories.java factories.java topology rewrite 👍 * Update Factories.java fix whitespace + forgot to add AriaGCM + SerpentGCM * desc RC6ECB.java placeholders, LE32.java * encblk+decblk funcs * RC6 done * desc - move Camellia to seperate - create CamelliaECB (it sucks, will fix it more after) * good fixes! * Rmv 16bfix (#14) * progress some progress was made. next commit will be working on Aria.java (its large so may take some time) * "invalid config" * Update Aria.java potential working! * bugfix * Sha224 fix (#15) * Update SHA224.java potential fix * Update pom.xml tested - works now! the entire fix was adding * 8L to the padding calculator thing xD * SHA384 is working LESGO! * Create SHA512.java * Sha512 impl (#16) * desc * Update SHA512.java * Update SHA512.java oookay a bit of opencode and a lot of time later its solved!
27 lines
901 B
Java
27 lines
901 B
Java
package de.caydenno1.xacrypto.hash;
|
|
|
|
public class ROT {
|
|
public static int ROTR(int x, int n){
|
|
return (x >>> n) | (x << (32 - n));
|
|
}
|
|
public static long ROTR64(long x, int n){
|
|
return (x >>> n) | (x << (64 - n));
|
|
}
|
|
public static int ROTL(int x, int n){
|
|
return (x << n) | (x >>> (32 - n));
|
|
}
|
|
public static long ROTL32(long v, int shift) { return ((v & 0xFFFFFFFFL << shift) | (v & 0xFFFFFFFFL >>> (32 - shift))) & 0xFFFFFFFFL; }
|
|
public static long[] ROTL64(long l, long r, int shift) {
|
|
long[] res = new long[2];
|
|
if (shift < 64) {
|
|
res[0] = (l << shift) | (r >>> (64 - shift));
|
|
res[1] = (r << shift) | (l >>> (64 - shift));
|
|
} else {
|
|
int s = shift - 64;
|
|
res[0] = (r << s) | (l >>> (64 - s));
|
|
res[1] = (l << s) | (r >>> (64 - s));
|
|
}
|
|
return res;
|
|
}
|
|
}
|