Module: OMQ::Blake3ZMQ::Crypto

Defined in:
lib/omq/blake3zmq/crypto.rb

Overview

Default crypto backend: x25519 (native C) + chacha20blake3 (Rust native).

Defined Under Namespace

Modules: Hash Classes: PrivateKey, PublicKey

Constant Summary collapse

CryptoError =
ChaCha20Blake3::DecryptionError
TAG_SIZE =
ChaCha20Blake3::TAG_SIZE
Cipher =
ChaCha20Blake3::Cipher
Stream =
ChaCha20Blake3::Stream

Class Method Summary collapse

Class Method Details

.random_bytes(n) ⇒ String

Generates cryptographically secure random bytes.

Parameters:

  • n (Integer)

    number of bytes to generate

Returns:

  • (String)

    random binary string



121
122
123
# File 'lib/omq/blake3zmq/crypto.rb', line 121

def random_bytes(n)
  SecureRandom.random_bytes(n)
end