This website works better with JavaScript
صفحهٔ اصلی
گشتوگذار
راهنما
ورود
kennyh
/
encryption_sm
دنبال کردن
1
ستاره دار
0
انشعاب
0
پروندهها
مشکلات
0
درخواست واکشی
0
ویکی
شاخه:
main
شاخهها
تگها
main
encryption_sm
/
.sisyphus
/
notepads
/
guomi-smart-card
/
decisions.md
decisions.md
854 B
لینک دائمی
تاريخچه
خام
Decisions — guomi-smart-card
Interface Selection
SPI1 (SCK1/SS1/MISO1/MOSI1) chosen — Slave mode, CPOL=0 CPHA=0
spiid=0, base address 0x70000000
DMA channel 1 (DMACCH1) for SPI RX via LLI
Protocol Design
Frame: SYNC(0xAA55,2B) + LEN(2B,big-endian) + CMD(1B) + PAYLOAD(N) + CRC16(2B)
Response: SYNC + LEN + STATUS(1B) + RESPONSE(N) + CRC16
17 commands: 0x01-0x06 (SM2), 0x10 (SM3), 0x20-0x26 (SM4+stream), 0x30-0x31 (key/cert), 0xF0 (info)
Key Management
SM2: on-chip generation, private key in eFlash (never exported), 1 slot
SM4: dynamically injected by host into RAM (not persisted)
eFlash storage: 4 pages x 512B at 0x00470000, log-structured, magic=0xA5C3
Testing Strategy
TDD with national crypto standard test vectors
On-chip self-test → UART output PASS/FAIL
No external test framework (bare metal)