INNER CODE UNIT · TypeScript
rotl
paulmillr/noble-ciphers · src/_arx.ts:84
export function rotl(a: number, b: number): number {
return (a << b) | (a >>> (32 - b));
}
/**
* ARX core function operating on 32-bit words. Ciphers must use u32 for efficiency.
* @param sigma - Sigma constants for the selected cipher layout.
* @param key - Expanded key words.
* @param nonce - Nonce and counter words prepared for the round function.
* @param output - Output block written in place.
* @param counter - Block counter value.
* @param rounds - Optional round count override.
*/
export type CipherCoreFn = (
sigma: TArg<Uint32Array>,
key: TArg<Uint32Array>,
nonce: TArg<Uint32Array>,
output: TArg<Uint32Array>,