diff --git a/DESCRIPTION b/DESCRIPTION index 50d1beca..c7bd4e77 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -65,7 +65,7 @@ Imports: ps, R6 (>= 2.4.1), rlang (>= 1.0.0), - secretbase (>= 0.4.0), + secretbase (>= 0.5.0), stats, tibble (>= 3.0.1), tidyselect (>= 1.1.0), diff --git a/NAMESPACE b/NAMESPACE index d83c02b0..b5841456 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -561,7 +561,7 @@ importFrom(rlang,inform) importFrom(rlang,is_installed) importFrom(rlang,quo_squash) importFrom(rlang,warn) -importFrom(secretbase,sha3) +importFrom(secretbase,shake256) importFrom(secretbase,siphash13) importFrom(stats,complete.cases) importFrom(stats,runif) diff --git a/R/tar_package.R b/R/tar_package.R index 94859333..b60b585f 100644 --- a/R/tar_package.R +++ b/R/tar_package.R @@ -26,7 +26,7 @@ #' @importFrom R6 R6Class #' @importFrom rlang abort as_function check_installed enquo inform #' is_installed quo_squash warn -#' @importFrom secretbase sha3 siphash13 +#' @importFrom secretbase shake256 siphash13 #' @importFrom stats complete.cases runif #' @importFrom tibble as_tibble #' @importFrom tidyselect all_of any_of contains ends_with everything diff --git a/R/tar_seed_create.R b/R/tar_seed_create.R index 89d0fdf2..8f560cca 100644 --- a/R/tar_seed_create.R +++ b/R/tar_seed_create.R @@ -32,10 +32,9 @@ #' aforementioned section of the paper using the #' `secretbase` package by Charlie Gao (2024) \doi{10.5281/zenodo.10553140}. #' To generate the 32-bit integer `seed` argument of `set.seed()` -#' for each target, `secretbase` generates a cryptographic SHA3 hash -#' and robustly converts it to 32-bit output using the SHAKE256 -#' extendable output function (XOF). `secretbase` uses algorithms from -#' the `Mbed TLS` C library. +#' for each target, `secretbase` generates a cryptographic hash using the +#' SHAKE256 extendable output function (XOF). `secretbase` uses algorithms +#' from the `Mbed TLS` C library. #' @return Integer of length 1, the target seed. #' @param name Character of length 1, target name. #' @param global_seed Integer of length 1, the overarching global @@ -59,5 +58,5 @@ tar_seed_create <- function(name, global_seed = NULL) { return(NA_integer_) } x <- list(as.character(name), as.integer(global_seed)) - secretbase::sha3(x = x, bits = 32L, convert = NA) + secretbase::shake256(x = x, bits = 32L, convert = NA) } diff --git a/man/tar_seed_create.Rd b/man/tar_seed_create.Rd index 5e0409c3..417fe1d3 100644 --- a/man/tar_seed_create.Rd +++ b/man/tar_seed_create.Rd @@ -56,10 +56,9 @@ under "How to produce parallel streams and substreams"). aforementioned section of the paper using the \code{secretbase} package by Charlie Gao (2024) \doi{10.5281/zenodo.10553140}. To generate the 32-bit integer \code{seed} argument of \code{set.seed()} -for each target, \code{secretbase} generates a cryptographic SHA3 hash -and robustly converts it to 32-bit output using the SHAKE256 -extendable output function (XOF). \code{secretbase} uses algorithms from -the \verb{Mbed TLS} C library. +for each target, \code{secretbase} generates a cryptographic hash using the +SHAKE256 extendable output function (XOF). \code{secretbase} uses algorithms +from the \verb{Mbed TLS} C library. } \references{ diff --git a/man/tar_seed_get.Rd b/man/tar_seed_get.Rd index 74c5da18..02a761a8 100644 --- a/man/tar_seed_get.Rd +++ b/man/tar_seed_get.Rd @@ -57,10 +57,9 @@ under "How to produce parallel streams and substreams"). aforementioned section of the paper using the \code{secretbase} package by Charlie Gao (2024) \doi{10.5281/zenodo.10553140}. To generate the 32-bit integer \code{seed} argument of \code{set.seed()} -for each target, \code{secretbase} generates a cryptographic SHA3 hash -and robustly converts it to 32-bit output using the SHAKE256 -extendable output function (XOF). \code{secretbase} uses algorithms from -the \verb{Mbed TLS} C library. +for each target, \code{secretbase} generates a cryptographic hash using the +SHAKE256 extendable output function (XOF). \code{secretbase} uses algorithms +from the \verb{Mbed TLS} C library. } \examples{ diff --git a/man/tar_seed_set.Rd b/man/tar_seed_set.Rd index 6c8e6554..8fba8db7 100644 --- a/man/tar_seed_set.Rd +++ b/man/tar_seed_set.Rd @@ -58,10 +58,9 @@ under "How to produce parallel streams and substreams"). aforementioned section of the paper using the \code{secretbase} package by Charlie Gao (2024) \doi{10.5281/zenodo.10553140}. To generate the 32-bit integer \code{seed} argument of \code{set.seed()} -for each target, \code{secretbase} generates a cryptographic SHA3 hash -and robustly converts it to 32-bit output using the SHAKE256 -extendable output function (XOF). \code{secretbase} uses algorithms from -the \verb{Mbed TLS} C library. +for each target, \code{secretbase} generates a cryptographic hash using the +SHAKE256 extendable output function (XOF). \code{secretbase} uses algorithms +from the \verb{Mbed TLS} C library. } \examples{