你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

【NUCLEO-H533RE评测】HASH对比测试

[复制链接]
埃斯提爱慕 发布时间:2024-7-15 16:38

https://shequ.stmicroelectronics.cn/thread-643647-1-1.html

在这个基础测评的基础上,使能HASH,并选择8-bit data。生成代码

image.png

在板卡介绍中复制了一段,作为文件数据。同时保存一份txt,用于对比

image.png

char* Input = "The STM32 Nucleo-64 board provides an affordable and flexible way for users to try out new concepts and build prototypes by choosing from the various combinations of performance and power consumption features provided by the STM32 microcontroller. For the compatible boards, the internal or external SMPS significantly reduces power consumption in Run mode.The ARDUINO® Uno V3 connectivity support and the ST morpho headers allow the easy expansion of the functionality of the STM32 Nucleo open development platform with a wide choice of specialized shields.The STM32 Nucleo-64 board does not require any separate probe as it integrates the ST-LINK debugger/programmer.The STM32 Nucleo-64 board comes with the STM32 comprehensive free software libraries and examples available with the STM32Cube MCU Package.";

      HAL_HASH_GetConfig(&hhash, &Conf);
      printf("\n\r");
      Conf.Algorithm = HASH_ALGOSELECTION_SHA1;
      HAL_HASH_SetConfig(&hhash, &Conf);
      HAL_HASH_Start(&hhash, (const uint8_t *) Input, strlen(Input), (uint8_t *)Output, 1000);
      hex_to_string(DispStr, Output, 20);
      printf("\n\rSHA1:");
      printf(DispStr);
      Conf.Algorithm = HASH_ALGOSELECTION_SHA256;
      HAL_HASH_SetConfig(&hhash, &Conf);
      HAL_HASH_Start(&hhash, (const uint8_t *) Input, strlen(Input), (uint8_t *)Output, 1000);
      hex_to_string(DispStr, Output, 32);
      printf("\n\rSHA256:");
      printf(DispStr);
      Conf.Algorithm = HASH_ALGOSELECTION_SHA384;
      HAL_HASH_SetConfig(&hhash, &Conf);
      HAL_HASH_Start(&hhash, (const uint8_t *) Input, strlen(Input), (uint8_t *)Output, 1000);
      hex_to_string(DispStr, Output, 48);
      printf("\n\rSHA384:");
      printf(DispStr);
      printf("\n\r");

编译运行,结果同网页在线生成的一致。

image.png

image.png

image.png
收藏 评论0 发布时间:2024-7-15 16:38

举报

0个回答
关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版