Skip to content

miniproto.crypto.native.scrypt_derive_cryptography

miniproto.crypto.native.scrypt_derive_cryptography

Section titled “miniproto.crypto.native.scrypt_derive_cryptography”
scrypt_derive_cryptography(password: bytes, salt: bytes, n: int, r: int, p: int, length: int) -> bytes

Derive Scrypt key material with the explicit cryptography backend.

Parameters:

  • password (bytes) – Secret input bytes.
  • salt (bytes) – Caller-selected salt bytes.
  • n (int) – Power-of-two CPU/memory cost.
  • r (int) – Block-size cost parameter.
  • p (int) – Parallelization cost parameter.
  • length (int) – Requested output length.

Returns:

  • bytes – Derived key bytes.

Raises:

  • ValueError – If the backend rejects the Scrypt parameters.

This bypasses Rust and leaves salt generation, resource budgeting, and secret lifetime to the caller.