ESP32-C3模组上跑通AES-GCM(5)

接前一篇文章:ESP32-C3模组上跑通AES-GCM(4)

四、ESP-IDF中的AES-GCM例程解析

上一回开始对于ESP-IDF中的AES-GCM进行讲解,讲解了components\components\mbedtls\test_apps\main\test_aes_gcm.c中例程的aes_gcm_test函数的第1部分中的第1段的第1个语句(说是一行代码,但其中包含的内容不少)。本回继续往下讲解第1段的余下内容。

1. aes_gcm_test函数

(1)为ciphertext(密文)和output分配空间

    uint8_t *ciphertext = heap_caps_malloc(cfg->plaintext_length, cfg->output_caps);
    uint8_t *output = heap_caps_malloc(cfg->plaintext_length, MALLOC_CAP_DMA | MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL);
 
    if (cfg->plaintext_length != 0) {
        TEST_ASSERT_NOT_NULL(ciphertext);
        TEST_ASSERT_NOT_NULL(output);
    }
 
    memset(ciphertext, 0, cfg->plaintext_length);
    memset(output, 0, cfg->plai

相关推荐

  1. ESP32-C3AES-GCM5

    2024-07-10 13:18:02       9 阅读
  2. openssl3.2 - exp - AES-256-GCM

    2024-07-10 13:18:02       21 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-10 13:18:02       4 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-10 13:18:02       5 阅读
  3. 在Django里面运行非项目文件

    2024-07-10 13:18:02       4 阅读
  4. Python语言-面向对象

    2024-07-10 13:18:02       5 阅读

热门阅读

  1. 如何在电子文件上加盖印章

    2024-07-10 13:18:02       10 阅读
  2. github 下载提速的几种方法

    2024-07-10 13:18:02       9 阅读
  3. 交替打印-GO

    2024-07-10 13:18:02       11 阅读
  4. 秒验 iOS端如何修改授权页背景

    2024-07-10 13:18:02       11 阅读
  5. 探索HTML5的设计原则:引领Web开发的未来方向

    2024-07-10 13:18:02       6 阅读
  6. hive 调优

    2024-07-10 13:18:02       8 阅读
  7. 精通C#编程需要学习哪些常用框架?

    2024-07-10 13:18:02       8 阅读
  8. Redis高可用解决方案哨兵模式与集群模式的比较

    2024-07-10 13:18:02       7 阅读