Skip to content

Commit

Permalink
Merge pull request #1272 from shikokuchuo/main
Browse files Browse the repository at this point in the history
switch to secretbase::shake256()
  • Loading branch information
wlandau committed Apr 30, 2024
2 parents adc116f + c17426b commit 65a94c8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions R/tar_seed_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
7 changes: 3 additions & 4 deletions man/tar_seed_create.Rd

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

7 changes: 3 additions & 4 deletions man/tar_seed_get.Rd

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

7 changes: 3 additions & 4 deletions man/tar_seed_set.Rd

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

0 comments on commit 65a94c8

Please sign in to comment.