INNER CODE UNIT · TypeScript

sigma32_32

paulmillr/noble-ciphers · src/_arx.ts:71

const sigma32_32 = /* @__PURE__ */ (() => swap32IfBE(u32(encodeStr('expand 32-byte k'))))();

/**
 * Rotates a 32-bit word left.
 * @param a - Input word.
 * @param b - Rotation count in bits.
 * @returns Rotated 32-bit word.
 * @example
 * Moves the top byte of `0x12345678` into the low byte position.
 * ```ts
 * rotl(0x12345678, 8);
 * ```
 */
export function rotl(a: number, b: number): number {
  return (a << b) | (a >>> (32 - b));
}

/**

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…