miniproto_native::crypto::scrypt_derive
Provenance
Section titled “Provenance”- Rust visibility:
restricted - Source:
rust/miniproto/src/crypto.rs - Python exposure:
miniproto._native.scrypt_derive(confirmed from adjacent PyO3 attributes)
Signature
Section titled “Signature”fn scrypt_derive(py: _, password: _, salt: _, n: u32, r: u32, p: u32, length: usize) -> _Arguments
Section titled “Arguments”py: The acquired GIL token used to detach only sufficiently large scrypt work.password: Password bytes accepted by scrypt.salt: Salt bytes accepted by scrypt.n: CPU/memory cost, required to be a power of two greater than one.r: scrypt block-size cost parameter.p: scrypt parallelization cost parameter.length: Requested derived-key length in the inclusive range 1..=1024.
cargo-docs-md rendering
Section titled “cargo-docs-md rendering”scrypt_derive
Section titled “scrypt_derive”fn scrypt_derive(py: Python<'_>, password: Vec<u8>, salt: Vec<u8>, n: u32, r: u32, p: u32, length: usize) -> PyResult<Vec<u8>>Defined in rust/miniproto/src/crypto.rs:446-463
Derives Python scrypt_derive bytes from password, salt and scrypt cost parameters.
n must be a power of two above one and length is limited to 1..=1024; invalid parameters
return ValueError. Estimated memory is capped at 256 MiB and aggregate work at 1 GiB. The
GIL is released when the 128 * n * r * p work estimate exceeds 4 KiB.
Arguments
Section titled “Arguments”py: The acquired GIL token used to detach only sufficiently large scrypt work.password: Password bytes accepted by scrypt.salt: Salt bytes accepted by scrypt.n: CPU/memory cost, required to be a power of two greater than one.r: scrypt block-size cost parameter.p: scrypt parallelization cost parameter.length: Requested derived-key length in the inclusive range 1..=1024.