Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/diagrams/seal-batch-flush-flow.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%% 封装主循环(第 7.8 节 封装流程总览)
%% 生成: npm exec --yes --package=@mermaid-js/mermaid-cli -- mmdc -i seal-batch-flush-flow.mmd -o seal-batch-flush-flow.png -b white -w 1200
flowchart TD
start([开始]) --> A{"宿主已声明输入结束<br/>且无新载荷?"}

A -->|否| B["输入单元入队<br/>滚动摘要更新 H"]
B --> C{"批刷写阈值<br/>S(Q) ≥ T_batch?"}
C -->|是| D["Item 写出<br/>Block 元信息更新<br/>清空 Q"]
C -->|否| A
D --> A

A -->|是| E{"Q 非空?"}
E -->|是| D2["Item 写出<br/>Block 元信息更新<br/>清空 Q"]
E -->|否| F["收尾落盘"]
D2 --> F
F --> endnode([结束])
Binary file added doc/diagrams/seal-batch-flush-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions doc/diagrams/unseal-main-flow.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
%% 解封主循环(第 8.5 节 解封流程总览)
%% npx @mermaid-js/mermaid-cli -i unseal-main-flow.mmd -o unseal-main-flow.png -b white -w 1200
flowchart TD
start([开始]) --> A["读 Header 并校验<br/>magic / version"]
A --> B["计算 content_size<br/>初始化 H = H0,n = 0"]
B --> C{"n 小于 item_number?"}

C -->|否| D{"H 等于 data_hash?"}
D -->|是| endnode([成功结束])
D -->|否| err1([完整性错误])

C -->|是| E["读 item_size 与 cipher_payload"]
E --> F["认证解密得批包 B"]
F --> G["拆分 B 得输入单元"]
G --> H["逐条输出 payload<br/>并用输入单元更新 H"]
H --> C

F -.->|失败| err2([认证或格式错误])
G -.->|失败| err2
Binary file added doc/diagrams/unseal-main-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading