Macro muddy::muddy_init

source ·
muddy_init!() { /* proc-macro */ }
Expand description

Initialization macro that must be called at the crate root. This sets up the scaffolding for the lazy decryption at runtime.

§Modes

Optional values that can be provided are:

  • “embed” (default)
  • “env”

§“embed”

If the “embed” mode is chosen, the key will be embedded in the binary with minor obfuscation (XORed with a random array).

§“env”

If “env” is provided, the key will not be embedded in the binary. An additional value may be provided to set the env key identifier:


muddy_init!("env", "MY_KEY");

Or at buildtime:


muddy_init!("env");

// run with `MUDDY='MY_KEY_NAME' cargo b`