Skip to content
ChaCha20
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
chacha20_block
chacha20_init_state
chacha20_quarter_round
util
LICENSE
README.md
mod.ts
test.ts
test_vectors.json

README.md

chacha20

ci

ChaCha20 as defined by RFC 8439

API

export const KEY_BYTES: number = 32;
export const NONCE_BYTES: number = 12;

export function chacha20(
  out: Uint8Array,
  key: Uint8Array,
  nonce: Uint8Array,
  counter: number,
  text: Uint8Array
): void;

chacha20 does not do any input validation. Make sure key and nonce have correct sizes and that counter is an uint32. Also, guarantee that out.byteLength === text.byteLength.

License

MIT

You can’t perform that action at this time.