diff --git a/README.Rmd b/README.Rmd index f50ee0f..85c23fc 100644 --- a/README.Rmd +++ b/README.Rmd @@ -37,6 +37,12 @@ Performs direct hashing of strings and raw vectors. Stream hashes files potentia Implementations include the SHA-256, SHA-3 and 'Keccak' cryptographic hash functions, SHAKE256 extendable-output function (XOF), and 'SipHash' pseudo-random function. +The SHA-3 Secure Hash Standard was published by the National Institute of Standards and Technology (NIST) in 2015 at [doi:10.6028/NIST.FIPS.202](https://dx.doi.org/10.6028/NIST.FIPS.202). SHA-3 is based on the Keccak algorithm, designed by G. Bertoni, J. Daemen, M. Peeters and G. Van Assche. + +The SHA-256 Secure Hash Standard was published by NIST in 2002 at . + +The SipHash family of pseudo-random functions by Jean-Philippe Aumasson and Daniel J. Bernstein was published in 2012 at .[1] + ### Overview ```{r secretbase} @@ -50,8 +56,7 @@ For the SHA-3 cryptographic hash algorithm, specify 'bits' as `224`, `256`, `384 ```{r sha3} sha3("secret base") sha3("secret base", convert = FALSE) -sha3("秘密の基地の中", bits = 512) - +sha3("秘密の基地の中", bits = 512L) ``` #### Hash strings and raw vectors @@ -66,7 +71,7 @@ All other objects are stream hashed using R serialization - portable as always uses R serialization version 3 big-endian representation, skipping headers (which contain R version and native encoding information) ```{r streaming} -sha3(data.frame(a = 1, b = 2), bits = 224) +sha3(data.frame(a = 1, b = 2), bits = 224L) sha3(NULL) ``` @@ -86,7 +91,7 @@ unlink(file) May be used as deterministic random seeds for R's pseudo random number generators (RNGs).
Specify 'convert' as `NA` (and 'bits' as `32` for a single integer value): ```{r integer} -shake256("秘密の基地の中", bits = 32, convert = NA) +shake256("秘密の基地の中", bits = 32L, convert = NA) ``` For use in parallel computing, this is a valid method for reducing to a negligible probability that RNGs in each process may overlap. This may be especially suitable when first-best alternatives such as using recursive streams are too expensive or unable to preserve reproducibility. [2] @@ -94,7 +99,7 @@ For use in parallel computing, this is a valid method for reducing to a negligib #### Keccak ```{r keccak} -keccak("secret base", bits = 384) +keccak("secret base", bits = 384L) ``` #### SHA-256 @@ -150,9 +155,9 @@ install.packages("secretbase", repos = "https://shikokuchuo.r-universe.dev") ### Implementation Notes -The SHA-3 Secure Hash Standard was published by the National Institute of Standards and Technology (NIST) in 2015 at [doi:10.6028/NIST.FIPS.202](https://dx.doi.org/10.6028/NIST.FIPS.202). SHA-3 is based on the Keccak algorithm, designed by G. Bertoni, J. Daemen, M. Peeters and G. Van Assche. The SHA-256 Secure Hash Standard was published by NIST in 2002 at . The SipHash family of pseudo-random functions by Jean-Philippe Aumasson and Daniel J. Bernstein was published in 2012 at .[1] +The SHA-256, SHA-3, Keccak, and base64 implementations are based on those by the 'Mbed TLS' Trusted Firmware Project at . -The SHA-256, SHA-3, Keccak, and base64 implementations are based on those by the 'Mbed TLS' Trusted Firmware Project at . The SipHash implementation is based on that of Daniele Nicolodi, David Rheinsberg and Tom Gundersen at , which is in turn based on the reference implementation by Jean-Philippe Aumasson and Daniel J. Bernstein released to the public domain at . +The SipHash implementation is based on that of Daniele Nicolodi, David Rheinsberg and Tom Gundersen at , which is in turn based on the reference implementation by Jean-Philippe Aumasson and Daniel J. Bernstein released to the public domain at . ### References diff --git a/README.md b/README.md index 9690b11..62131a6 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,19 @@ Implementations include the SHA-256, SHA-3 and ‘Keccak’ cryptographic hash functions, SHAKE256 extendable-output function (XOF), and ‘SipHash’ pseudo-random function. +The SHA-3 Secure Hash Standard was published by the National Institute +of Standards and Technology (NIST) in 2015 at +[doi:10.6028/NIST.FIPS.202](https://dx.doi.org/10.6028/NIST.FIPS.202). +SHA-3 is based on the Keccak algorithm, designed by G. Bertoni, J. +Daemen, M. Peeters and G. Van Assche. + +The SHA-256 Secure Hash Standard was published by NIST in 2002 at +. + +The SipHash family of pseudo-random functions by Jean-Philippe Aumasson +and Daniel J. Bernstein was published in 2012 at +.\[1\] + ### Overview ``` r @@ -50,7 +63,7 @@ sha3("secret base") sha3("secret base", convert = FALSE) #> [1] a7 21 d5 75 70 e7 ce 36 6a de e2 fc cb e9 77 07 23 c6 e3 62 25 49 c3 1c 7c #> [26] ab 9d bb 4a 79 55 20 -sha3("秘密の基地の中", bits = 512) +sha3("秘密の基地の中", bits = 512L) #> [1] "e30cdc73f6575c40d55b5edc8eb4f97940f5ca491640b41612e02a05f3e59dd9c6c33f601d8d7a8e2ca0504b8c22f7bc69fa8f10d7c01aab392781ff4ae1e610" ``` @@ -70,7 +83,7 @@ All other objects are stream hashed using R serialization encoding information) ``` r -sha3(data.frame(a = 1, b = 2), bits = 224) +sha3(data.frame(a = 1, b = 2), bits = 224L) #> [1] "03778aad53bff7dd68caab94374bba6f07cea235fb97b3c52cf612e9" sha3(NULL) #> [1] "b3e37e4c5def1bfb2841b79ef8503b83d1fed46836b5b913d7c16de92966dcee" @@ -94,7 +107,7 @@ generators (RNGs).
Specify ‘convert’ as `NA` (and ‘bits’ as `32` for a single integer value): ``` r -shake256("秘密の基地の中", bits = 32, convert = NA) +shake256("秘密の基地の中", bits = 32L, convert = NA) #> [1] 2000208511 ``` @@ -107,7 +120,7 @@ reproducibility. \[2\] #### Keccak ``` r -keccak("secret base", bits = 384) +keccak("secret base", bits = 384L) #> [1] "c82bae24175676028e44aa08b9e2424311847adb0b071c68c7ea47edf049b0e935ddd2fc7c499333bccc08c7eb7b1203" ``` @@ -181,24 +194,14 @@ install.packages("secretbase", repos = "https://shikokuchuo.r-universe.dev") ### Implementation Notes -The SHA-3 Secure Hash Standard was published by the National Institute -of Standards and Technology (NIST) in 2015 at -[doi:10.6028/NIST.FIPS.202](https://dx.doi.org/10.6028/NIST.FIPS.202). -SHA-3 is based on the Keccak algorithm, designed by G. Bertoni, J. -Daemen, M. Peeters and G. Van Assche. The SHA-256 Secure Hash Standard -was published by NIST in 2002 at -. The -SipHash family of pseudo-random functions by Jean-Philippe Aumasson and -Daniel J. Bernstein was published in 2012 at -.\[1\] - The SHA-256, SHA-3, Keccak, and base64 implementations are based on those by the ‘Mbed TLS’ Trusted Firmware Project at -. The SipHash -implementation is based on that of Daniele Nicolodi, David Rheinsberg -and Tom Gundersen at , which is in -turn based on the reference implementation by Jean-Philippe Aumasson and -Daniel J. Bernstein released to the public domain at +. + +The SipHash implementation is based on that of Daniele Nicolodi, David +Rheinsberg and Tom Gundersen at , +which is in turn based on the reference implementation by Jean-Philippe +Aumasson and Daniel J. Bernstein released to the public domain at . ### References