| rev | 
   line source | 
| 
jbe@499
 | 
     1 --[[--
 | 
| 
jbe@499
 | 
     2 hash =              -- SHA3-224 digest (in hex notation) of input string
 | 
| 
jbe@499
 | 
     3 moonhash.sha3_224(
 | 
| 
jbe@499
 | 
     4   data              -- input string
 | 
| 
jbe@499
 | 
     5 )
 | 
| 
jbe@499
 | 
     6 
 | 
| 
jbe@499
 | 
     7 Calculates the SHA3-224 checksum with a security of 112 bits for collision attacks and 224 bits for preimage and second preimage attacks.
 | 
| 
jbe@499
 | 
     8 
 | 
| 
jbe@499
 | 
     9 --]]--
 | 
| 
jbe@499
 | 
    10 -- Implemented in moonhash.c and moonhash_sha3.c
 | 
| 
jbe@499
 | 
    11 --//--
 | 
| 
jbe@499
 | 
    12 
 | 
| 
jbe@499
 | 
    13 
 | 
| 
jbe@499
 | 
    14 --[[--
 | 
| 
jbe@499
 | 
    15 hash =              -- SHA3-256 digest (in hex notation) of input string
 | 
| 
jbe@499
 | 
    16 moonhash.sha3_256(
 | 
| 
jbe@499
 | 
    17   data              -- input string
 | 
| 
jbe@499
 | 
    18 )
 | 
| 
jbe@499
 | 
    19 
 | 
| 
jbe@499
 | 
    20 Calculates the SHA3-256 checksum with a security of 128 bits for collision attacks and 256 bits for preimage and second preimage attacks.
 | 
| 
jbe@499
 | 
    21 
 | 
| 
jbe@499
 | 
    22 --]]--
 | 
| 
jbe@499
 | 
    23 -- Implemented in moonhash.c and moonhash_sha3.c
 | 
| 
jbe@499
 | 
    24 --//--
 | 
| 
jbe@499
 | 
    25 
 | 
| 
jbe@499
 | 
    26 
 | 
| 
jbe@499
 | 
    27 --[[--
 | 
| 
jbe@499
 | 
    28 hash =              -- SHA3-384 digest (in hex notation) of input string
 | 
| 
jbe@499
 | 
    29 moonhash.sha3_384(
 | 
| 
jbe@499
 | 
    30   data              -- input string
 | 
| 
jbe@499
 | 
    31 )
 | 
| 
jbe@499
 | 
    32 
 | 
| 
jbe@499
 | 
    33 Calculates the SHA3-384 checksum with a security of 192 bits for collision attacks and 384 bits for preimage and second preimage attacks.
 | 
| 
jbe@499
 | 
    34 
 | 
| 
jbe@499
 | 
    35 --]]--
 | 
| 
jbe@499
 | 
    36 -- Implemented in moonhash.c and moonhash_sha3.c
 | 
| 
jbe@499
 | 
    37 --//--
 | 
| 
jbe@499
 | 
    38 
 | 
| 
jbe@499
 | 
    39 
 | 
| 
jbe@499
 | 
    40 --[[--
 | 
| 
jbe@499
 | 
    41 hash =              -- SHA3-512 digest (in hex notation) of input string
 | 
| 
jbe@499
 | 
    42 moonhash.sha3_512(
 | 
| 
jbe@499
 | 
    43   data              -- input string
 | 
| 
jbe@499
 | 
    44 )
 | 
| 
jbe@499
 | 
    45 
 | 
| 
jbe@499
 | 
    46 Calculates the SHA3-512 checksum with a security of 512 bits for collision attacks and 256 bits for preimage and second preimage attacks.
 | 
| 
jbe@499
 | 
    47 
 | 
| 
jbe@499
 | 
    48 --]]--
 | 
| 
jbe@499
 | 
    49 -- Implemented in moonhash.c and moonhash_sha3.c
 | 
| 
jbe@499
 | 
    50 --//--
 | 
| 
jbe@499
 | 
    51 
 | 
| 
jbe@499
 | 
    52 
 | 
| 
jbe@499
 | 
    53 --[[--
 | 
| 
jbe@506
 | 
    54 hash =              -- SHAKE128 digest of input string
 | 
| 
jbe@506
 | 
    55 moonhash.shake128(
 | 
| 
jbe@506
 | 
    56   input_data,       -- input string
 | 
| 
jbe@506
 | 
    57   output_length,    -- number of characters (not bytes or bits) in output, defaults to 32
 | 
| 
jbe@506
 | 
    58   output_alphabet   -- characters for encoding, defaults to "0123456789abcdef" for hex encoding
 | 
| 
jbe@499
 | 
    59 )
 | 
| 
jbe@499
 | 
    60 
 | 
| 
jbe@506
 | 
    61 Calculates a SHAKE128 digest (FIPS 202) with a security of math.min(128, math.log(#output_alphabet, 2) * output_length/2) for collision attacks and math.min(128, math.log(#output_alphabet, 2) * output_length) for preimage and second preimage attacks. If #output_alphabet is a power of 2, a direct base-N encoding is performed. Otherwise, a base-N encoding with N equal to the next higher power of 2 is performed, and all character values smaller than or equal to #output_alphabet are discarded from the stream (the process is repeated until the hash length reaches the required output_length).
 | 
| 
jbe@499
 | 
    62 
 | 
| 
jbe@499
 | 
    63 --]]--
 | 
| 
jbe@499
 | 
    64 -- Implemented in moonhash.c and moonhash_sha3.c
 | 
| 
jbe@499
 | 
    65 --//--
 | 
| 
jbe@499
 | 
    66 
 | 
| 
jbe@499
 | 
    67 
 | 
| 
jbe@506
 | 
    68 --[[--
 | 
| 
jbe@506
 | 
    69 hash =              -- SHAKE256 digest of input string
 | 
| 
jbe@506
 | 
    70 moonhash.shake256(
 | 
| 
jbe@506
 | 
    71   input_data,       -- input string
 | 
| 
jbe@506
 | 
    72   output_length,    -- number of characters (not bytes or bits) in output, defaults to 64
 | 
| 
jbe@506
 | 
    73   output_alphabet   -- characters for encoding, defaults to "0123456789abcdef" for hex encoding
 | 
| 
jbe@506
 | 
    74 )
 | 
| 
jbe@506
 | 
    75 
 | 
| 
jbe@506
 | 
    76 Calculates a SHAKE256 digest (FIPS 202) with a security of math.min(256, math.log(#output_alphabet, 2) * output_length/2) for collision attacks and math.min(256, math.log(#output_alphabet, 2) * output_length) for preimage and second preimage attacks. If #output_alphabet is a power of 2, a direct base-N encoding is performed. Otherwise, a base-N encoding with N equal to the next higher power of 2 is performed, and all character values smaller than or equal to #output_alphabet are discarded from the stream (the process is repeated until the hash length reaches the required output_length).
 | 
| 
jbe@506
 | 
    77 
 | 
| 
jbe@506
 | 
    78 --]]--
 | 
| 
jbe@506
 | 
    79 -- Implemented in moonhash.c and moonhash_sha3.c
 | 
| 
jbe@506
 | 
    80 --//--
 | 
| 
jbe@506
 | 
    81 
 |