【问题标题】:how to add an crypto algorithm to linux crypto api如何将加密算法添加到 linux crypto api
【发布时间】:2021-10-16 06:13:11
【问题描述】:

我需要将特定的加密算法添加到 Linux 加密 API,以便我可以在 /proc/crypto 中看到它并在 IPsec ESP 中使用它。有没有为 Linux 内核开发加密算法的模板?

【问题讨论】:

    标签: linux cryptography kernel


    【解决方案1】:

    您需要使用内核 Crypto API(但我不建议推出您自己的加密算法)。您使用此函数调用注册您的加密算法。

    int crypto_register_alg(struct crypto_alg *alg);
    

    但请确保您首先正确填写了struct crypto_algstruct crypto_alg Link 保存有关您的算法的信息,其中还包含 struct cipher_alg Link 反过来又包含指向加密和解密函数的指针。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-18
      • 2016-06-14
      • 1970-01-01
      • 1970-01-01
      • 2013-12-27
      • 2021-07-31
      • 1970-01-01
      相关资源
      最近更新 更多