isScalar function
This function checks whether a Uint8List represents a scalar value. In many cryptographic contexts, scalar values are expected to be 32 bytes long. It returns true if the input Uint8List has a length of 32 bytes, indicating it's a scalar; otherwise, it returns false.
Implementation
bool isScalar(Uint8List x) {
/// Check if the length of the input Uint8List is equal to 32 bytes.
return x.length == 32;
}