← Back to Pull requests

enhance(ECDH): reconstruct ECDH #2123

Closed
unknown closed this pull request without merging on Jul 19, 2022 16:30 UTC
View on GitHub
unknown unknown commented on Jun 30, 2022 06:39 UTC
Author

Metadate


ABI Change: No
Supersed #1928

Changelog


Common


common: 移动特定于 QQ 平台的实现到 OicqECDH,重新设计 ECDH,使 ECDH 类只针对算法本身,而不过多包括 QQ 协议的使用细节

感觉这样结构似乎更清晰一点

JVM-like Platform


jvm: 尝试优先使用平台加密实现,可能改善性能(and fallback to BouncyCastleProvider explicitly)
jvm & android: 使用 curveName secp256r1 代替 prime256v1,前者在 Java 中更常用,可以被更多的 JCE 实现所识别(虽然都是指同一条曲线)
android: 使用系统自带的实现以减少依赖,并尝试兼容 Android P+ 版本
Starting in Android P, we plan to deprecate some functionality from the BC provider that's duplicated by the AndroidOpenSSL (also known as Conscrypt) provider.

(View origin)

所以 Android P+ 上也是可以使用自带的加密库的,只是不应该指定 provider = "BC"

Native


native(openssl): 中间储存密钥时,保留 OpenSSL 内部数据结构,而不反复 new & free,以便提高性能
(为了实现智能指针,需要用到 @ExperimentalStdlibApi 的 createCleaner,但个人认为这种风险应该可以接受)
native(openssl): 直接使用 point/bignum 到 bytes 的转换,避免了使用 hex string 作为中间层,提高效率(EC_POINT_point2oct / EC_POINT_oct2point)
~mingwx64: 新增使用系统自带实现BCrypt~ (没有启用,写到快结束才发现BCRYPT_KDF_RAW_SECRET要Win8.1及以上版本才能用,而Oicq用的又是非常见的密钥派生方式,似乎必须要拿到 raw secret 手动处理才能可用 😢,还没想好通过何种方式提供 option,先放这里了)

Diff: 148 lines (+111 / -37) across 1 files Reviewer: sandtechnology Review duration: 27950m
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 148 lines diff across 1 files
0.33
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.299
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2123"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 32.9% (LOW) · Higher = larger blast radius
32.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 13% · Safe to merge
13%
Repository