Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sha2: fix missing documentation on compression functions #266

Merged
merged 1 commit into from May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/sha2.yml
Expand Up @@ -70,6 +70,7 @@ jobs:
- run: cargo test --target ${{ matrix.target }} --release --no-default-features
- run: cargo test --target ${{ matrix.target }} --release
- run: cargo test --target ${{ matrix.target }} --release --features asm
- run: cargo test --target ${{ matrix.target }} --release --all-features

# macOS tests
macos:
Expand Down
3 changes: 3 additions & 0 deletions sha2/Cargo.toml
Expand Up @@ -39,3 +39,6 @@ compress = [] # Expose compress function
force-soft = [] # Force software implementation
asm-aarch64 = ["asm"] # DEPRECATED: use `asm` instead

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
1 change: 1 addition & 0 deletions sha2/src/lib.rs
Expand Up @@ -53,6 +53,7 @@
//! [2]: https://github.com/RustCrypto/hashes

#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
Expand Down
5 changes: 5 additions & 0 deletions sha2/src/sha256.rs
Expand Up @@ -163,6 +163,11 @@ cfg_if::cfg_if! {
}
}

/// Raw SHA-256 compression function.
///
/// This is a low-level "hazmat" API which provides direct access to the core
/// functionality of SHA-256.
#[cfg_attr(docsrs, doc(cfg(feature = "compress")))]
pub fn compress256(state: &mut [u32; 8], blocks: &[GenericArray<u8, U64>]) {
// SAFETY: GenericArray<u8, U64> and [u8; 64] have
// exactly the same memory layout
Expand Down
5 changes: 5 additions & 0 deletions sha2/src/sha512.rs
Expand Up @@ -241,6 +241,11 @@ cfg_if::cfg_if! {
}
}

/// Raw SHA-512 compression function.
///
/// This is a low-level "hazmat" API which provides direct access to the core
/// functionality of SHA-512.
#[cfg_attr(docsrs, doc(cfg(feature = "compress")))]
pub fn compress512(state: &mut [u64; 8], blocks: &[GenericArray<u8, U128>]) {
// SAFETY: GenericArray<u8, U128> and [u8; 128] have
// exactly the same memory layout
Expand Down