Skip to content

Commit

Permalink
re-organise docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Mar 17, 2024
1 parent 94848bf commit 838c9b0
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 68 deletions.
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Package: secretbase
Type: Package
Title: Cryptographic Hash and Extendable-Output Functions
Version: 0.3.0.9002
Description: SHA-256, SHA-3 cryptographic hash and SHAKE256 extendable-output
functions (XOF). The SHA-3 Secure Hash Standard was published by the
National Institute of Standards and Technology (NIST) in 2015 at
Version: 0.3.0.9003
Description: Fast and memory-efficient streaming hash functions for strings, raw
bytes, files and in-memory objects using R's serialization mechanism.
Implementations include the SHA-256 and SHA-3 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>. The SHA-256 Secure Hash Standard was published
by NIST in 2002 at
<https://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf>. Fast and
memory-efficient implementation using the core algorithms from 'Mbed TLS'
under the Trusted Firmware Project
<https://www.trustedfirmware.org/projects/mbed-tls/>.
<https://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf>.
Authors@R:
c(person(given = "Charlie",
family = "Gao",
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# secretbase 0.3.0.9002 (development)
# secretbase 0.3.0.9003 (development)

* Adds SipHash-1-3 pseudorandom function (PRF).

Expand Down
57 changes: 30 additions & 27 deletions R/base.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,11 @@

#' secretbase: Cryptographic Hash and Extendable-Output Functions
#'
#' Fast and memory-efficient implementations of the SHA-256, SHA-3 cryptographic
#' hash functions, SHAKE256 extendable-output function (XOF), and 'SipHash'
#' pseudo-random function. \cr\cr The SHA-3 cryptographic hash functions are
#' SHA3-224, SHA3-256, SHA3-384 and SHA3-512, each an instance of the Keccak
#' algorithm. SHAKE256 is one of the two XOFs of the SHA-3 family, along
#' with SHAKE128 (not implemented).
#'
#' @references The SHA-3 Secure Hash Standard was published by the National
#' Institute of Standards and Technology (NIST) in 2015 at
#' \doi{doi:10.6028/NIST.FIPS.202}.
#'
#' The SHA-256 Secure Hash Standard was published by NIST in 2002 at
#' \url{https://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf}.
#'
#' \pkg{secretbase} adapts the SHA-256 and SHA-3 implementations by the
#' 'Mbed TLS Contributors' at \url{https://github.com/Mbed-TLS/mbedtls}
#' under the 'Mbed TLS' Trusted Firmware Project
#' \url{https://www.trustedfirmware.org/projects/mbed-tls/}.
#'
#' The SipHash family of cryptographically-strong pseudorandom functions
#' (PRFs) are described in 'SipHash: a fast short-input PRF', Jean-Philippe
#' Aumasson and Daniel J. Bernstein, Paper 2012/351, 2012, Cryptology ePrint
#' Archive at \url{https://ia.cr/2012/351}.
#'
#' \pkg{secretbase} adapts the SipHash streaming implementation by Daniele
#' Nicolodi, David Rheinsberg and Tom Gundersen at
#' \url{https://github.com/c-util/c-siphash}.
#' Fast and memory-efficient streaming hash functions for strings, raw bytes,
#' files and in-memory objects using R's serialization mechanism.
#' Implementations include the SHA-256 and SHA-3 cryptographic hash
#' functions, SHAKE256 extendable-output function (XOF), and 'SipHash'
#' pseudo-random function.
#'
#' @encoding UTF-8
#' @author Charlie Gao \email{charlie.gao@@shikokuchuo.net}
Expand Down Expand Up @@ -81,6 +59,14 @@
#' @details To produce single integer values suitable for use as random seeds
#' for R's pseudo random number generators (RNGs), set 'bits' to 32 and
#' 'convert' to NA.
#'
#' The SHA-3 Secure Hash Standard was published by the National Institute of
#' Standards and Technology (NIST) in 2015 at
#' \doi{doi:10.6028/NIST.FIPS.202}.
#'
#' This implementation is based on that of 'The Mbed TLS Contributors' under
#' the 'Mbed TLS' Trusted Firmware Project at
#' \url{https://www.trustedfirmware.org/projects/mbed-tls/}.
#'
#' @examples
#' # SHA3-256 hash as character string:
Expand Down Expand Up @@ -119,6 +105,14 @@ sha3 <- function(x, bits = 256L, convert = TRUE, file)
#' @inheritParams sha3
#'
#' @return A character string, raw or integer vector depending on 'convert'.
#'
#' @details The SHA-256 Secure Hash Standard was published by the National
#' Institute of Standards and Technology (NIST) in 2002 at
#' \url{https://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf}.
#'
#' This implementation is based on that of 'The Mbed TLS Contributors' under
#' the 'Mbed TLS' Trusted Firmware Project at
#' \url{https://www.trustedfirmware.org/projects/mbed-tls/}.
#'
#' @examples
#' # SHA-256 hash as character string:
Expand Down Expand Up @@ -150,6 +144,15 @@ sha256 <- function(x, convert = TRUE, file)
#' trailing '0'. Note: for character vectors only the first element is used.
#'
#' @return A character string, raw or integer vector depending on 'convert'.
#'
#' @details The SipHash family of cryptographically-strong pseudorandom
#' functions (PRFs) are described in 'SipHash: a fast short-input PRF',
#' Jean-Philippe Aumasson and Daniel J. Bernstein, Paper 2012/351, 2012,
#' Cryptology ePrint Archive at \url{https://ia.cr/2012/351}.
#'
#' This implementation is based on the SipHash streaming implementation by
#' Daniele Nicolodi, David Rheinsberg and Tom Gundersen at
#' \url{https://github.com/c-util/c-siphash}.
#'
#' @examples
#' # SipHash-1-3 hash as character string:
Expand Down
4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ knitr::opts_chunk$set(
[![DOI](https://zenodo.org/badge/745691432.svg)](https://zenodo.org/doi/10.5281/zenodo.10553139)
<!-- badges: end -->

Fast and memory-efficient implementations of the SHA-256, SHA-3 cryptographic hash functions, SHAKE256 extendable-output function (XOF), and 'SipHash' pseudo-random function.
Fast and memory-efficient streaming hash functions for strings, raw bytes, files and in-memory objects using R's serialization mechanism.

Implementations include the SHA-256 and SHA-3 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). The SHA-256 Secure Hash Standard was published by NIST in 2002 at <https://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf>. The SipHash family of pseudo-random functions by Jean-Philippe Aumasson and Daniel J. Bernstein was published in 2012 at <https://ia.cr/2012/351>.<sup>[1]</sup>

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ badge](https://shikokuchuo.r-universe.dev/badges/secretbase?color=e4723a)](https
[![DOI](https://zenodo.org/badge/745691432.svg)](https://zenodo.org/doi/10.5281/zenodo.10553139)
<!-- badges: end -->

Fast and memory-efficient implementations of the SHA-256, SHA-3
cryptographic hash functions, SHAKE256 extendable-output function (XOF),
and ‘SipHash’ pseudo-random function.
Fast and memory-efficient streaming hash functions for strings, raw
bytes, files and in-memory objects using R’s serialization mechanism.

Implementations include the SHA-256 and SHA-3 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
Expand Down
33 changes: 5 additions & 28 deletions man/secretbase-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions man/sha256.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions man/sha3.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions man/siphash13.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 838c9b0

Please sign in to comment.