crytic/roundme
GitHub: crytic/roundme
人工辅助的舍入分析工具,用于确定算术运算的舍入方向并生成审计报告。
Stars: 103 | Forks: 10
# roundme
`roundme` 是一个人工辅助的舍入分析器。它帮助操作者确定算术运算应该向上舍入还是向下舍入。
## 功能
- 推荐算术运算需要向上舍入还是向下舍入
- 生成基于 LaTeX 的 PDF 报告
## 规则
`rounding()` 是结果的预期舍入方向(向上或向下)
- `A + B => rounding(A), rounding(B)` (加法不改变舍入方向)
- `A - B => rounding(A), ! rounding(B)` (被减元素的舍入方向与预期舍入方向相反)
- `A * B => rounding(A), rounding(B), rounding(*) ` (乘法不改变舍入方向)
- `A / B => rounding(A), ! rounding(B), rounding(/)` (分母的舍入方向与预期舍入方向相反)
- `A ** B`
- `If A>=1 => rounding(A), rounding(B)`
- `If A<1 => rounding(A), ! rounding(B)` (如果 A 小于 1,指数的舍入方向与预期舍入方向相反)
## 如何使用
- 运行 `roundme init-sample` 以生成默认配置文件。
- 运行 `roundme init` 以生成用户配置文件。
- 运行 `roundme analyze` 以分析配置文件
- 运行 `roundme analyze --output-format pdf` 以生成 PDF (需要 [latexmk](https://mg.readthedocs.io/latexmk.html))
在默认配置下运行 `roundme analyze --output-format pdf` 将生成以下内容:
### 配置
`roundme` 依赖于一个配置文件:
```
formula: a * b / c
round_up: true
less_than_one: ["a * b"] # optional
greater_than_one: ["c"] # optional
```
- `formula` 包含要分析的公式
- `round_up` 确定公式的结果应向上舍入还是向下舍入
- `less_than_one` 用于 `**` [规则](#rules) *(原始字符串比较,对空格敏感)*
- `greater_than_one` 用于 `**` [规则](#rules) *(原始字符串比较,对空格敏感)*
参见 [balancer V2](./examples/balancer/README.md) 示例。
## 安装
安装使用
```
cargo install roundme
```
安装最新的 GitHub 版本
```
git clone git@github.com:crytic/roundme.git
cd roundme
cargo install --path .
```
### 配置
`roundme` 依赖于一个配置文件:
```
formula: a * b / c
round_up: true
less_than_one: ["a * b"] # optional
greater_than_one: ["c"] # optional
```
- `formula` 包含要分析的公式
- `round_up` 确定公式的结果应向上舍入还是向下舍入
- `less_than_one` 用于 `**` [规则](#rules) *(原始字符串比较,对空格敏感)*
- `greater_than_one` 用于 `**` [规则](#rules) *(原始字符串比较,对空格敏感)*
参见 [balancer V2](./examples/balancer/README.md) 示例。
## 安装
安装使用
```
cargo install roundme
```
安装最新的 GitHub 版本
```
git clone git@github.com:crytic/roundme.git
cd roundme
cargo install --path .
```
标签:CTF工具, Latex报告生成, 云安全监控, 云计算, 可视化界面, 形式化验证, 数值计算, 数学库安全, 整数溢出, 漏洞搜索, 符号执行, 算术分析, 精度丢失, 舍入误差检测, 规则引擎, 辅助分析, 通知系统, 通知系统, 静态分析