惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tenable Blog
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - panrui

模拟电子器件的恒流特性 python环境下的加密库import Crypto失败解决 TI的C2000系列处理器的Flash使用指导手册 TI的TMS320的MCU的16位地址的特点 使用开源音频软件去分析声音的频率成分 SVPWM波形分区 python的使用 什么是xml c语言中const关键字的使用 Cross compilation 程序流监控 飞思卡尔的工具freemaster和powerpc调试器的配合使用 汽车电子sent协议的使用 Autosar 入门 INCA 如何让标定的map显示成立体的图形的形式 ASPICE的实践 安装ubuntu后的U盘(tf卡)恢复到之前的状态 ssh的使用 bash脚本的判断语句之一 推测执行 Speculative execution 什么是cache Assembler Instructions with C Expression Operands
csec的key更新
panrui · 2022-09-13 · via 博客园 - panrui

在对csec的使用中(其他遵循hsm key update协议的芯片也适用),kdf的运算过程中遇到的数据都是128bit。不需要考虑padding的问题。
目前并没有找到对padding的一致性的处理方式。

对于Miyaguchi-Preneel compression的具体计算过程,Wikipedia中存在相应的算法解释。

https://en.wikipedia.org/wiki/One-way_compression_function

AES的CBC模式:

    mbedtls_aes_context aes;
    mbedtls_aes_init( &aes );
    ret = mbedtls_aes_setkey_enc( &aes, k1, 128u );
    ret = mbedtls_aes_crypt_cbc( &aes, MBEDTLS_AES_ENCRYPT, ATOMIC_BUFSIZE*2, IV_zero, data_connected, pM2); /*  */
    mbedtls_aes_free( &aes );

AES的ECB模式:

    mbedtls_aes_context aes;
    mbedtls_aes_init( &aes );
    ret = mbedtls_aes_setkey_enc( &aes, tempIV, 128u );
    ret = mbedtls_aes_crypt_ecb( &aes, MBEDTLS_AES_ENCRYPT, key, tempENC_Text);
    mbedtls_aes_free( &aes );

CMAC算法:

    const mbedtls_cipher_info_t *cipher_info;

    cipher_info = mbedtls_cipher_info_from_type( MBEDTLS_CIPHER_AES_128_ECB );
    ret = mbedtls_cipher_cmac( cipher_info, k2, 128u, data_connected, M1_SIZE + M2_SIZE, pM3);

注意,CMAC的计算模式也是CBC模式,由于CBC模式的初始化向量必然要用到,相关的NIST公开规范中规定初始化向量为全零值。

/* The Fid can be considered as always 6bits. no matter the SFE is 0x00 or 0x01.
* Align the Fid to the leftest postion.
*
* */