fscrypt_new_context(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

hiii bestie πŸ’– welcome to fscrypt_new_context(9) from the Kernel API Manual πŸŽ€ β€” this one is literally about creating a new fscrypt_context, no cap.


🌸 SYNOPSIS 🌸

the way this function pulls up is lowkey iconic:

int fscrypt_new_context (union fscrypt_context *ctx_u , const union
       fscrypt_policy *policy_u , const u8 nonce[FSCRYPT_FILE_NONCE_SIZE] );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctx_u β€” the output context 🫢 β€” like, this is where the new context goes.
  • policy_u β€” the input policy ✨ β€” the encryption policy you're working with.
  • nonce β€” the nonce to use πŸ‘€ β€” and the description has a whole rule about this one: it must be a new random nonce. not me catching you trying to reuse one πŸ’…

πŸ’– DESCRIPTION πŸ’–

okay so this function creates an fscrypt_context for an inode that is being assigned the given encryption policy 🌈. that's the main character move.

and bestie, listen: nonce must be a new random nonce πŸ”₯. like, fr fr, do not play with that. fresh random nonce only.


πŸ‘‘ RETURN πŸ‘‘

it returns the size of the new context in bytes β€” that's the whole return vibe, periodt πŸ’…βœ¨.


πŸŽ€ SEE ALSO πŸŽ€

peep the kernel file over at ./fs/crypto/policy.c πŸ‘€, plus these function besties:


mwah πŸ’‹ this page's source/version is ./fs/crypto, and it's dated October 2026 β€” cute little sign-off, slay πŸ§šπŸ’œ

πŸ“¦ where this page comes from