quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

stream_salsa2012.c (520B)


      1 #include "crypto_stream_salsa2012.h"
      2 #include "randombytes.h"
      3 
      4 size_t
      5 crypto_stream_salsa2012_keybytes(void)
      6 {
      7     return crypto_stream_salsa2012_KEYBYTES;
      8 }
      9 
     10 size_t
     11 crypto_stream_salsa2012_noncebytes(void)
     12 {
     13     return crypto_stream_salsa2012_NONCEBYTES;
     14 }
     15 
     16 size_t
     17 crypto_stream_salsa2012_messagebytes_max(void)
     18 {
     19     return crypto_stream_salsa2012_MESSAGEBYTES_MAX;
     20 }
     21 
     22 void
     23 crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES])
     24 {
     25     randombytes_buf(k, crypto_stream_salsa2012_KEYBYTES);
     26 }