Library crypto

To use this library in your code:

import crypto
Cryptographic functions.

Exported classes

Base for checksum algorithms.

Elliptic Curve Integrated Encryption Scheme (ECIES).

A pair of EC keys generated together.

Functions

random --size/int -> ByteArray
Generates a byte array of the given size filled with random bytes.
Advanced
On the ESP32, the function is mapped to esp_random (https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/random.html#_CPPv410esp_randomv). As such, the numbers are only truly random if the RF subsystem (WiFi or Bluetooth) is enabled. Otherwise, the numbers should be considered pseudo-random.
On other platforms, the function uses std::random_device (see https://en.cppreference.com/w/cpp/numeric/random/random_device). On Linux and macOS, this uses /dev/urandom as a source of randomness. On Windows, it uses the Windows Cryptographic API (CAPI) to generate random numbers.

Exported functions

checksum summer/Checksum data/Data from/int=0 to/int=data.byte-size -> ByteArray
Computes the hash of the given data.
The data must be a string or a byte array.