Skip to content

Commit

Permalink
maintain targets 1.7.0 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Jun 16, 2024
1 parent 24ec32f commit 5ff8162
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 33 deletions.
15 changes: 7 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
Package: secretbase
Type: Package
Title: Cryptographic Hash and Extendable-Output Functions
Version: 0.5.0.9002
Description: Fast and memory-efficient streaming hash functions. Performs direct
hashing of strings and raw vectors. Stream hashes files potentially larger
than memory, as well as in-memory objects through R's serialization
mechanism. Implementations include the SHA-256, SHA-3 and 'Keccak'
cryptographic hash functions, SHAKE256 extendable-output function (XOF), and
'SipHash' pseudo-random function. Base 64 encoding and decoding of strings,
raw vectors and serialized objects.
Version: 0.5.0.9003
Description: Fast and memory-efficient streaming hash functions and base64
encoding and decoding. Performs direct hashing of strings and raw vectors.
Stream hashes files potentially larger than memory, as well as in-memory
objects through R's serialization mechanism. Implementations include the
SHA-256, SHA-3 and 'Keccak' cryptographic hash functions, SHAKE256
extendable-output function (XOF), and 'SipHash' pseudo-random function.
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.5.0.9002 (development)
# secretbase 0.5.0.9003 (development)

* Adds base64 encoding and decoding.
* `sha3()` restricts 'bit' argument to one of 224, 256, 384 or 512.
Expand Down
13 changes: 6 additions & 7 deletions R/secret.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@

#' secretbase: Cryptographic Hash and Extendable-Output Functions
#'
#' Fast and memory-efficient streaming hash functions. Performs direct hashing
#' of strings and raw vectors. Stream hashes files potentially larger than
#' memory, as well as in-memory objects through R's serialization mechanism.
#' Implementations include the SHA-256, SHA-3 and 'Keccak' cryptographic
#' hash functions, SHAKE256 extendable-output function (XOF), and 'SipHash'
#' pseudo-random function. Base 64 encoding and decoding of strings, raw
#' vectors and serialized objects.
#' Fast and memory-efficient streaming hash functions and base64 encoding and
#' decoding. Performs direct hashing of strings and raw vectors. Stream
#' hashes files potentially larger than memory, as well as in-memory objects
#' through R's serialization mechanism. Implementations include the SHA-256,
#' SHA-3 and 'Keccak' 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
4 changes: 1 addition & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ knitr::opts_chunk$set(
\/_______/
```

Fast and memory-efficient streaming hash functions. Performs direct hashing of strings and raw vectors. Stream hashes files potentially larger than memory, as well as in-memory objects through R's serialization mechanism.
Fast and memory-efficient streaming hash functions and base64 encoding and decoding. Performs direct hashing of strings and raw vectors. Stream hashes files potentially larger than memory, as well as in-memory objects through R's serialization mechanism.

Implementations include the SHA-256, SHA-3 and 'Keccak' cryptographic hash functions, SHAKE256 extendable-output function (XOF), and 'SipHash' pseudo-random function.

Base64 encoding and decoding of strings, raw vectors and serialized objects.

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 <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>

The SHA-256, SHA-3, Keccak, and base64 implementations are based on those by the 'Mbed TLS' Trusted Firmware Project at <https://www.trustedfirmware.org/projects/mbed-tls>. The SipHash implementation is based on that of Daniele Nicolodi, David Rheinsberg and Tom Gundersen at <https://github.com/c-util/c-siphash>, which is in turn based on the reference implementation by Jean-Philippe Aumasson and Daniel J. Bernstein released to the public domain at <https://github.com/veorq/SipHash>.
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ badge](https://shikokuchuo.r-universe.dev/badges/secretbase?color=e4723a)](https
\ / base /
\/_______/

Fast and memory-efficient streaming hash functions. Performs direct
hashing of strings and raw vectors. Stream hashes files potentially
larger than memory, as well as in-memory objects through R’s
serialization mechanism.
Fast and memory-efficient streaming hash functions and base64 encoding
and decoding. Performs direct hashing of strings and raw vectors. Stream
hashes files potentially larger than memory, as well as in-memory
objects through R’s serialization mechanism.

Implementations include the SHA-256, SHA-3 and ‘Keccak’ cryptographic
hash functions, SHAKE256 extendable-output function (XOF), and ‘SipHash’
pseudo-random function.

Base64 encoding and decoding of strings, raw vectors and serialized
objects.

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).
Expand Down
13 changes: 6 additions & 7 deletions man/secretbase-package.Rd

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

2 changes: 2 additions & 0 deletions src/secret.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ static SEXP secretbase_sha3_impl(const SEXP x, const SEXP bits, const SEXP conve
id = MBEDTLS_SHA3_224 + offset; break;
case 384:
id = MBEDTLS_SHA3_384 + offset; break;
case 32: // for targets 1.7.0 compat
id = MBEDTLS_SHA3_SHAKE256; break;
default:
id = MBEDTLS_SHA3_SHAKE256;
Rf_error("'bits' must be 224, 256, 384 or 512");
Expand Down

0 comments on commit 5ff8162

Please sign in to comment.