hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

README (1136B)


      1 crypto::salsa provides an implementation of the Salsa20 and XSalsa20 stream
      2 ciphers, per "Salsa20 specification" by Daniel J. Bernstein.
      3 
      4 Use [[salsa20]] to create a stream and either [[xsalsa20_init]] or
      5 [[salsa20_init]] to set handle, key and nonce of the appropriate size,
      6 [[NONCESZ]] for salsa20 or [[XNONCESZ]] for XSalsa20. After calling the
      7 appropriate init function, [[io::write]] may be used to encrypt blocks to the
      8 handle or [[io::read]] to decrypt blocks from the handle. The stream must be
      9 closed with [[io::close]] to wipe sensitive data from memory.
     10 
     11 Writing blocks of length [[BLOCKSZ]] is not required. However, seeking the key
     12 stream with [[setctr]] only operates in units of [[BLOCKSZ]].
     13 
     14 This is a low-level module which implements cryptographic primitives. Direct use
     15 of cryptographic primitives is not recommended for non-experts, as incorrect use
     16 of these primitives can easily lead to the introduction of security
     17 vulnerabilities. Non-experts are advised to use the high-level operations
     18 available in the top-level [[crypto::]] module.
     19 
     20 Be advised that Hare's cryptography implementations have not been audited.