You are currently viewing Linux Kernel Begins Phasing Out the crypto_rng Layer to Simplify Random Number Generation

Linux Kernel Begins Phasing Out the crypto_rng Layer to Simplify Random Number Generation

Linux Kernel Begins Phasing Out the crypto_rng Layer to Simplify Random Number Generation

Linux kernel developers are moving forward with plans to remove the crypto_rng API layer, a long-standing component of the kernel’s cryptographic subsystem. The proposed change is part of a broader effort to simplify the kernel’s internal architecture by eliminating redundant code paths and encouraging developers to rely on the kernel’s modern random number generation interfaces instead. (phoronix.com)

Although the change happens entirely behind the scenes, it reflects the Linux kernel community’s ongoing commitment to reducing technical debt, improving maintainability, and modernizing core infrastructure.

What Is the crypto_rng Layer?

The crypto_rng framework is an API within the Linux kernel’s Crypto API that provides random number generation services for kernel components.

Historically, it allowed different kernel subsystems and drivers to request random data through a generic cryptographic interface. Over time, however, the kernel’s dedicated random number generator has matured considerably, making much of the crypto_rng abstraction unnecessary. (kernel.org)

Today, developers generally recommend using the kernel’s built-in random number generation functions directly instead of routing requests through the older crypto layer.

Why Developers Want to Remove It

According to discussions on the Linux kernel mailing list, the crypto_rng layer has become largely redundant.

Modern kernel code already relies on well-established interfaces such as:

  • get_random_bytes()
  • get_random_u32()
  • get_random_u64()

These functions are maintained as part of the kernel’s primary random number generation subsystem and are widely used throughout Linux. Maintaining an additional abstraction layer increases code complexity without providing significant practical benefits. (phoronix.com)

Removing unnecessary infrastructure also makes the kernel easier to maintain and audit over the long term.

Simplifying the Crypto API

The Linux Crypto API has evolved significantly over the years as new algorithms, hardware accelerators, and security features have been introduced.

Kernel maintainers have increasingly focused on: