Crypto::ChaCha20::Native
Inherits Crypto::ChaCha20::Cipher < Reference < Object
The ChaCha20 cipher is a high-speed cipher. It is considerably faster than AES in software-only implementations, making it around three times as fast on platforms that lack specialized AES hardware. ChaCha20 is also not sensitive to timing attacks.
This is the pure Crystal scalar implementation.
Constants
BLOCK_SIZE = Crypto::ChaCha20::BLOCK_SIZE
Constructors
The inputs to ChaCha20 are:
- key: A 256-bit key, treated as a concatenation of eight 32-bit little- endian integers.
- nonce: A 96-bit nonce, treated as a concatenation of three 32-bit little- endian integers.
- counter: A 32-bit block count parameter, treated as a 32-bit little-endian integer.
The inputs to ChaCha20 are:
- key: A 256-bit key, treated as a concatenation of eight 32-bit little- endian integers. (hex encoded)
- nonce: A 96-bit nonce, treated as a concatenation of three 32-bit little- endian integers. (hex encoded)
- counter: A 32-bit block count parameter, treated as a 32-bit little-endian integer.
Instance methods
reads from plaintext and writes to encrypted