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

autodoc: std.crypto.core.aes documentation is hard to reach #22312

Open
sorairolake opened this issue Dec 25, 2024 · 0 comments
Open

autodoc: std.crypto.core.aes documentation is hard to reach #22312

sorairolake opened this issue Dec 25, 2024 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@sorairolake
Copy link
Contributor

Zig Version

0.14.0-dev.2563+af5e73172

Steps to Reproduce and Observed Behavior

First, open the link to std.crypto.core.aes:

std.crypto.core.aes

Next, open the link to std.crypto.core.aes.AesEncryptCtx:

std.crypto.core.aes.AesEncryptCtx

Next, open the link to impl.AesEncryptCtx:

impl.AesEncryptCtx

I thought I would be able to view the documentation for this type function, but in fact, the result returned was "Declaration not found" as shown in the image above.

Search for AesEncryptCtx to find documentation for backend type functions:

search results for AesEncryptCtx

Documentation for std.crypto.aes.aesni.AesEncryptCtx:

std.crypto.aes.aesni.AesEncryptCtx

I think it's inconvenient that we can't find this document without searching. I think this issue occurs when using different backends depending on the conditions (CPU architecture, etc.), just like with std.crypto.core.aes.

Expected Behavior

We can view the documentation by opening the link to std.crypto.core.aes.AesEncryptCtx or impl.AesEncryptCtx.

It might be good to be able to open the documentation in aes/aesni.zig when builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and has_aesni and has_avx is true in the environment where the documentation was built.

const impl = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and has_aesni and has_avx) impl: {
break :impl @import("aes/aesni.zig");
} else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes)
impl: {
break :impl @import("aes/armcrypto.zig");
} else impl: {
break :impl @import("aes/soft.zig");
};

The above is just an example, there may be a better way.

@sorairolake sorairolake added the bug Observed behavior contradicts documented or intended behavior label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant