INNER CODE UNIT · TypeScript

full

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

    const full = Math.floor((len - outPos) / this.blockLen);
    if (full > 0) {
      const blockBytes = full * this.blockLen;
      const b = out.subarray(outPos, outPos + blockBytes);
      this.cipher(this.key, this.nonce, b as TRet<Uint8Array>, b as TRet<Uint8Array>, this.ctr);
      this.ctr += full;
      outPos += blockBytes;
    }
    // Save leftovers
    const left = len - outPos;
    if (left > 0) {
      this.buf.fill(0);
      // NOTE: cipher will handle overflow
      this.cipher(
        this.key,
        this.nonce,
        this.buf as TRet<Uint8Array>,
        this.buf as TRet<Uint8Array>,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…