This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430F6777A:AES 加密问题

Guru**** 2382970 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1183252/msp430f6777a-aes-encryption-problem

器件型号:MSP430F6777A

大家好、

尝试使用 AES 外设、但很难找到有关此主题的示例项目或代码脚本。 阅读用户手册中的"AES 加速器"部分后、我尝试使用 MSP 驱动程序库创建一个示例。 驱动程序库函数看起来正常、因为它们遵循用户手册中所述的相同路径。 但是、当我尝试加密 AES 标准中描述的大多数基本数据时、结果是失败的。 即使转换成功中断也不会触发。 请分享以下代码、感谢您提供任何帮助。

    // main function has these setup for AES peripheral
    // Which calls "deneme_thread" function
    // Global Interrupts also enabled before this part
    
    AES_reset(AES_BASE);
    AES_enableInterrupt(AES_BASE);
    trk_PushMessageNullUserData(&deneme_thread, msg_ProcessAfter1s);

#include "aes.h"

const uint8_t* CRYPTOKEY = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
const uint8_t* CRYPTOMESSAGE = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
uint8_t* CRYPTOOUT;
uint8_t* DECRYPTOOUT;

unsigned long deneme_thread(void* user_data)
{
    AES_setCipherKey(AES_BASE, CRYPTOKEY);
    AES_startEncryptData(AES_BASE, CRYPTOMESSAGE, CRYPTOOUT);

    ipa_Print(CRYPTOOUT);           // Serial communication function to observe data at terminal
    return msg_ProcessAfter1s * 5;  // This function performs every 5 sec
}

#pragma vector = AES_VECTOR
__interrupt void AES_ISR (void)
{
    ipa_Print("\nPOLONEZKOYDEYIM"); // expected to see this message at terminal every succesfull conversion
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    函数和封装数据正确、但无法触发中断?

    您是否检查了 gobal 中断是否已启用?

    您可以尝试在 main.c:GIE 中添加此代码

    谢谢!

    此致

    Johnson