Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
abd89bf
키 수립, TLS 크레이트 추가, TODO 수정
Quant-TheodoreFelix Mar 5, 2026
cec8a01
HKDF, DSA 크레이트 추가 및 key-establishment 크레이트 모듈작업
Quant-TheodoreFelix Mar 5, 2026
bd0de3c
라이선스 주석 제거
Quant-TheodoreFelix Mar 6, 2026
4a17430
import 구문 최적화
Quant-TheodoreFelix Mar 6, 2026
283e8ec
secure_buffer.rs Docstring 수정 및 핵심 보안 기능 추가
Quant-TheodoreFelix Mar 6, 2026
e0130b3
hex 크레이트 제거 및 바이너리 옮김
Quant-TheodoreFelix Mar 6, 2026
bf087e6
entlib-native-hex 크레이트 추가 구현
Quant-TheodoreFelix Mar 6, 2026
736b584
NIST SP 800-56C Rev.2에 따른 HKDF 기능 구현
Quant-TheodoreFelix Mar 6, 2026
aeebfea
상수-시간 연산 크레이트 기능강화, 보안 버퍼 보안성 강화 및 기능강화, 크레이트 상위 디렉토리 변경 (기존 몇 가지 크레이…
Quant-TheodoreFelix Mar 12, 2026
d6c8f8a
FFI 수정
Quant-TheodoreFelix Mar 12, 2026
c92638f
Base64 기능 수정, Base64 FFI 함수 수정
Quant-TheodoreFelix Mar 12, 2026
3e2c036
FFI 크레이트 의존성 수정
Quant-TheodoreFelix Mar 12, 2026
c2ee461
FFI 크레이트 해시 모듈 제거
Quant-TheodoreFelix Mar 12, 2026
4c82ee0
SHA-2, SHA-3 보안 강화 및 FFI 함수 수정
Quant-TheodoreFelix Mar 12, 2026
35375ac
HEX 인/디코딩 크레이트, FFI 모듈 추가
Quant-TheodoreFelix Mar 12, 2026
2aeebb4
상수-시간 크레이트 CC의거 보안 강도 강화
Quant-TheodoreFelix Mar 13, 2026
57322ff
상수-시간 크레이트 벤치마킹 문서 수정
Quant-TheodoreFelix Mar 13, 2026
00661be
SHA-2 KCMVP CAVP 테스트 코드 추가
Quant-TheodoreFelix Mar 13, 2026
841cfe2
SHA-3 KCMVP CAVP 테스트 코드 추가
Quant-TheodoreFelix Mar 13, 2026
cdef495
RNG 크레이트 전체 수정 작업 시작
Quant-TheodoreFelix Mar 13, 2026
3d9bed6
이전 커밋에서 Base64 크레이트 전체 리팩토링됨
Quant-TheodoreFelix Mar 13, 2026
02941e7
HKDF SHA-2 크레이트 추가
Quant-TheodoreFelix Mar 13, 2026
6cc1dbf
HMAC SHA-2 크레이트 추가
Quant-TheodoreFelix Mar 13, 2026
1d6c080
워크플로에서 사용될 상수-시간 크레이트 타겟 함수 자동 추출 스크립트 추가
Quant-TheodoreFelix Mar 13, 2026
365ec85
HEX 인/디코딩 크레이트 추가
Quant-TheodoreFelix Mar 13, 2026
4685b88
CHACHA20 크레이트 초기화 예정, 크레이트 리팩토링
Quant-TheodoreFelix Mar 13, 2026
61ed438
전체 안정화에 따른 알파 버전업 -> Alpha2
Quant-TheodoreFelix Mar 13, 2026
0a57388
스크립트 롤백
Quant-TheodoreFelix Mar 13, 2026
c8b743b
워크플로 추가 및 PR 타겟 브랜치 수정
Quant-TheodoreFelix Mar 13, 2026
6ceb496
전체 린터 수정
Quant-TheodoreFelix Mar 13, 2026
2b8c126
워크플로 내 경로 수정
Quant-TheodoreFelix Mar 13, 2026
f5ef1d5
상수-시간 함수 추출 스크립트 수정
Quant-TheodoreFelix Mar 13, 2026
9370c82
워크플로 및 상수-시간 함수 추출 스크립트 수정
Quant-TheodoreFelix Mar 13, 2026
298b4c7
빌드, Valgrind 로직, 워크플로 및 상수-시간 함수 추출 스크립트 수정
Quant-TheodoreFelix Mar 13, 2026
87b13a9
HKDF 테스트 제거, RNG 크레이트 초기화
Quant-TheodoreFelix Mar 13, 2026
ceb525a
워크플로 오류 수정
Quant-TheodoreFelix Mar 14, 2026
71755aa
워크플로 오류 수정
Quant-TheodoreFelix Mar 14, 2026
5c9d933
루트에서 프로파일 관리하도록 수정
Quant-TheodoreFelix Mar 14, 2026
9faf50a
러스트 툴체인 컴포넌트 추가 유도
Quant-TheodoreFelix Mar 14, 2026
dd2be3d
타겟 브랜치 변경
Quant-TheodoreFelix Mar 14, 2026
6da2c45
워크플로 보안 강화
Quant-TheodoreFelix Mar 14, 2026
d48dd61
불필요 어셈블리 수정
Quant-TheodoreFelix Mar 14, 2026
70e83aa
상수-시간 audit 피처를 통해 래핑 관리
Quant-TheodoreFelix Mar 14, 2026
b677982
Level 1 검증부 명령 수정
Quant-TheodoreFelix Mar 14, 2026
ad31dba
상수-시간 함수 추출 스크립트에 누락된 피처 플래그 추가
Quant-TheodoreFelix Mar 14, 2026
430ad32
https://github.com/Quant-Off/entlib-native/pull/9#issuecomment-405996…
Quant-TheodoreFelix Mar 14, 2026
7e3b40f
보안 노트 추가
Quant-TheodoreFelix Mar 14, 2026
37a0126
Valgrind 부분 수정, 하이퍼콜 수정
Quant-TheodoreFelix Mar 14, 2026
89debf5
초기 명세 문서 추가
Quant-TheodoreFelix Mar 14, 2026
f0dc4cb
매뉴얼 구현 수정
Quant-TheodoreFelix Mar 14, 2026
5f865ce
표준 함수명과 겹치는 함수명 수정 및 린터 수정
Quant-TheodoreFelix Mar 14, 2026
29b4537
전체 린터 및 매뉴얼 구현 수정
Quant-TheodoreFelix Mar 14, 2026
f1e7b64
valgrind 테스트 코드 전체 수정, 보안성 강화
Quant-TheodoreFelix Mar 14, 2026
4699c4c
린터 수정
Quant-TheodoreFelix Mar 14, 2026
746b516
사용법 수정
Quant-TheodoreFelix Mar 14, 2026
bd871db
SecureBuffer 크레이트 보안성 강화 https://github.com/Quant-Off/entlib-native/p…
Quant-TheodoreFelix Mar 15, 2026
0bcdad0
CC Level 3 임시 비활성화, Level 2 스크립트화 및 기여 문서 수정
Quant-TheodoreFelix Mar 15, 2026
55dcd00
std linux 환경이 아닌 환경에서 "fetch_os_page_size" 함수 사용 불가능 에러 해결
Quant-TheodoreFelix Mar 15, 2026
daaa064
CC Level 2 DudeCT 검증 임시 비활성화
Quant-TheodoreFelix Mar 15, 2026
7d17989
unsafe 블럭 수정
Quant-TheodoreFelix Mar 15, 2026
3c69e41
HMAC SHA-3 구현, MacResult 구조체 필드 SecureBuffer 로 수정에 따른 부분 사용 변경
Quant-TheodoreFelix Mar 15, 2026
1df1851
HKDF SHA-2, 3 구현
Quant-TheodoreFelix Mar 15, 2026
388a707
`1.1.2` 릴리즈
Quant-TheodoreFelix Mar 15, 2026
c0e696f
unsafe 처리
Quant-TheodoreFelix Mar 15, 2026
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
112 changes: 112 additions & 0 deletions .github/workflows/cc-constant-time-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CC Constant-Time Hybrid Audit

on:
push:
branches: [ "master", "release/*" ]
pull_request:
branches: [ "master" ]

# 실제 운영(Production) 및 폐쇄망(Air-Gapped) 환경 적용 시에는 외부 Github Actions Runner 대신
# 내부망에 구축된 Self-hosted Runner와 사내 Harbar같은 레지스트리에 검증 도구(cargo-show-asm, valgrind)가
# 사전 설치된 무결성 컨테이너 이미지를 `container:` 지시어를 통해 사용해야 합니다!!!

jobs:
# 정적 어셈블리 검증
static-asm-audit:
name: Level 1 - Static ASM Analysis
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu

steps:
- name: Checkout Source Code
uses: actions/checkout@v3

- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@1.93.1
with:
components: rust-src
targets: ${{ matrix.target }}

# 폐쇄망 적용 시 이 단계는 생략되고 사전 빌드된 컨테이너 내장 도구를 사용해야 함
- name: Install cargo-show-asm (Supply Chain Audit Required)
run: cargo install cargo-show-asm --locked

- name: Inspect and Verify Assembly Output
shell: bash
run: |
echo "[entlib-native asm ct audit] 대상 아키텍처: ${{ matrix.target }}"

if [[ "${{ matrix.target }}" == *"x86_64"* ]]; then
FORBIDDEN_REGEX="\b(je|jne|jg|jge|jl|jle|ja|jae|jb|jbe)\b"
elif [[ "${{ matrix.target }}" == *"aarch64"* ]]; then
FORBIDDEN_REGEX="\b(b\.[a-z]{2}|cbz|cbnz|tbz|tbnz)\b"
else
echo "지원하지 않는 아키텍처입니다!"
exit 1
fi

# 1. 추출 스크립트 실행 (동적 audit_wrapper 생성 포함)
chmod +x scripts/extract_ct_symbols.sh
scripts/extract_ct_symbols.sh ${{ matrix.target }}

# 2. JSON 파싱을 통해 bash 배열로 복원
mapfile -t DYNAMIC_TARGETS < <(jq -r '.[]' target_functions.json)

# 3. 추출된 동적 래퍼 심볼에 대해 전수 검증 수행
for FUNC in "${DYNAMIC_TARGETS[@]}"; do
echo "-> $FUNC 검증 중..."

cargo asm -p entlib-native-constant-time --lib --features audit_mode --rust --target ${{ matrix.target }} --release "$FUNC" > asm_output.txt

if grep -q -E "$FORBIDDEN_REGEX" asm_output.txt; then
echo "[CRITICAL] $FUNC 에서 타이밍 공격을 유발할 수 있는 조건부 분기 명령어가 탐지되었습니다!"
grep -E "$FORBIDDEN_REGEX" asm_output.txt
exit 1
fi
done
echo "[SUCCESS] 추출된 ${#DYNAMIC_TARGETS[@]}개 함수의 어셈블리 무결성 전수 확인 완료"

# 동적 통계적 타이밍 분석 (DudeCT) TODO: 퀀트 컨테이너 안정화 후 가동 (필요 자료에 대한 폐쇄망 무결성 검증 중)
# dynamic-timing-audit:
# name: Level 2 - Dynamic Timing Analysis (DudeCT)
# needs: static-asm-audit
# runs-on: [self-hosted, bare-metal]
# steps:
# - uses: actions/checkout@v3
# - name: Install Rust Toolchain (Nightly)
# uses: dtolnay/rust-toolchain@nightly
# - name: Enforce CPU Frequency Scaling Policy (Linux)
# run: sudo cpupower frequency-set --governor performance || true
# - name: Run DudeCT Statistical Analysis
# run: |
# echo "[검증] DudeCT 기반 런타임 통계 분석 시작"
# scripts/catch_hex_dudect_audit.sh

# 바이너리 메모리 오염 추적 (Taint Analysis) TODO: 어떻게 동작하는지 아직 잘 모르겠어서 추 후 재검토
# taint-tracking-audit:
# name: Level 3 - Taint Flow Tracking (Valgrind)
# needs: static-asm-audit
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Source Code
# uses: actions/checkout@v3
# - name: Install Rust Toolchain (Nightly Only)
# uses: dtolnay/rust-toolchain@nightly
# with:
# components: rust-src
# # 폐쇄망 적용 시 이 단계는 생략되고 사전 빌드된 컨테이너(valgrind 내장)를 사용해야 함
# - name: Install System Dependencies for C-FFI and Valgrind
# run: |
# sudo apt-get update && sudo apt-get install -y build-essential valgrind libc6-dbg
# cargo install cargo-valgrind --locked
# # 여기까지
#
# - name: Run Memcheck with Uninitialized Value Tracking
# run: |
# echo "[검증] Valgrind Memcheck 기반 분기 오염 역추적"
# cargo +nightly valgrind test -p entlib-native-constant-time --test taint_audit --features valgrind_taint_audit -- --nocapture
4 changes: 2 additions & 2 deletions .github/workflows/verify_ct_asm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Constant-Time Assembly Verification

on:
push:
branches: [ "master", "fix/*", "feature/*" ]
branches: [ "master", "fix/*" ]
pull_request:
branches: [ "master", "fix/*", "feature/*" ]
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always
Expand Down
25 changes: 20 additions & 5 deletions COMPLIANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,38 @@ NIST CAVP는 단일 알고리즘에 대한 검증 작업입니다. 실제 프로

- [ ] SP 800-90A DRBG(Deterministic Random Bit Generators)

> [KCMVP](https://seed.kisa.or.kr/kisa/kcmvp/EgovVerification.do) (KS X ISO/IEC 18031)

- [ ] Security techniques - Hash-functions - Part 3: Dedicated hash-functions (2018)

## SHA2

> [NIST CAVP - Secure Hashing](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/secure-hashing) (ISO/IEC 10118-3)
> [NIST CAVP - Secure Hashing](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/secure-hashing)

- [ ] FIPS 180-4 SHA Test Vectors for Hashing Bit/Byte-Oriented Messages

> [KCMVP](https://seed.kisa.or.kr/kisa/kcmvp/EgovVerification.do) KS X ISO/IEC 10118-3:2001
> [KCMVP](https://seed.kisa.or.kr/kisa/kcmvp/EgovVerification.do) (KS X ISO/IEC 10118-3:2001)

- [ ] Security techniques - Hash-functions - Part 3: Dedicated hash-functions (2018)

## SHA3

> [NIST CAVP - Secure Hashing](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/secure-hashing) (ISO/IEC 10118-3)
> [NIST CAVP - Secure Hashing](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/secure-hashing)

- [X] FIPS 202 SHA-3 Hash Function Test Vectors for Hashing Bit/Byte-Oriented Messages
- [X] FIPS 202 SHA-3 XOF Test Vectors for Bit/Byte-Oriented Output

> [KCMVP](https://seed.kisa.or.kr/kisa/kcmvp/EgovVerification.do) KS X ISO/IEC 10118-3:2001
> [KCMVP](https://seed.kisa.or.kr/kisa/kcmvp/EgovVerification.do) (KS X ISO/IEC 10118-3:2001)

- [X] Security techniques - Hash-functions - Part 3: Dedicated hash-functions (2018)

## HKDF

> [NIST CAVP - Key Derivation](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/key-derivation) (SP 800-108)

- [X] Security techniques - Hash-functions - Part 3: Dedicated hash-functions (2018)
- [ ] KDF in Counter Mode Test Vectors
- [ ] KDF in Feedback Mode Test Vectors where no counter is used
- [ ] KDF in Feedback Mode Test Vectors where zero length IV is allowed
- [ ] KDF in Feedback Mode Test Vectors where zero length IV is not allowed
- [ ] KDF in Double-Pipeline Iteration Mode Test Vectors where no counter is used
- [ ] KDF in Double-Pipeline Iteration Mode Test Vectors where counter is used
17 changes: 16 additions & 1 deletion CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 기여 및 라이선스

> [English CONTRIBUTION](CONTRIBUTION_EN.md)

_안녕하세요. 저희는 팀 퀀트(Quant)이며, 저는 Quant Theodore Felix라고 합니다._

**이 프로젝트에 기여해주시는 모든 여러분에게 정말 감사드리며,** 몇 가지 사전 준비 사항을 알려드리고자 합니다. 우선, 이 프로젝트는 [`MIT LICENSE`](LICENSE)를 따릅니다.
Expand Down Expand Up @@ -50,6 +52,19 @@ _안녕하세요. 저희는 팀 퀀트(Quant)이며, 저는 Quant Theodore Felix
- 데이터 소거에 대해, 그 방식 또는 현재 구현된 로직에 대해 의견이 있으신가요?
- **현재 구현된 전반적인 보안 로직의 보안성이 엄밀하지 않다고 판단되시나요?**

# 최신 릴리즈 업데이트 기준 주요 기여

이 프로젝트에 있어 다음 항목에 해당하는 기여는 저희가 1순위로 검토합니다(물론 보안 기여는 0순위입니다).

- 공통
- 많은 크레이트의 핵심 기능은 `Result` 열거형을 통해 `SecureBuffer` 구조체와 문자열 참조를 반환합니다. 이는 오류 전파에 부적절합니다.
- 보안 버퍼 크레이트 `entlib-native-secure-buffer`
- `zeroizer.rs` 내 no_std 폐쇄 환경을 위한 Fall-back 시, 해당 환경의 하드웨어(CPU) 특성에 따라 캐시 라인 플러시가 보장되지 않을 수 있다고 합니다. 이 부분에 대해 섬세한 평가검증이 필요합니다.
- CI 워크플로
- CC 상수-시간 감사 워크플로의 Level 3(바이너리 메모리 오염 추적)은 Unix 환경에서 Valgrind를 사용하여 테스트를 수행합니다. 하지만 저는 아직 이 부분에 대해 큰 아이디어가 없어 임시 비활성화해둔 상태입니다. 이 부분에 대해 좋은 아이디어를 가지고 있다면 알려주세요.

# 연락

여러분은 위 내용에 있어 (특정 항목만 제외하고) 어떤 방식으로든 저희에게 연락하실 수 있습니다.

이메일 <qtfelix@qu4nt.space> 또는 디스코드 `qtfelix`를 사용하실 수 있습니다.
이메일 <qtfelix@qu4nt.space> 또는 디스코드 `qtfelix`를 사용하실 수 있습니다.
15 changes: 15 additions & 0 deletions CONTRIBUTION_EN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Contribution and License

> [Korean CONTRIBUTION](CONTRIBUTION.md)

_Hello. We are Team Quant, and I am Quant Theodore Felix._

**We truly appreciate everyone who contributes to this project,** and we would like to inform you of a few prerequisites. First of all, this project follows the [`MIT LICENSE`](LICENSE).
Expand Down Expand Up @@ -50,6 +52,19 @@ The above rules might just be an eyesore. If you fall into one of the following
- Do you have opinions on data erasure, its method, or the currently implemented logic?
- **Do you judge that the security of the overall security logic currently implemented is not rigorous?**

# Key Contributions Based on Latest Release Updates

For this project, contributions corresponding to the following items are our top priority for review (of course, security contributions are priority 0).

- Common
- Core functions in many crates return a `SecureBuffer` struct and a string reference via the `Result` enum. This is inappropriate for error propagation.
- Security Buffer Crate `entlib-native-secure-buffer`
- During fall-back for `no_std` isolated environments in `zeroizer.rs`, it is said that cache line flushing may not be guaranteed depending on the hardware (CPU) characteristics of that environment. Delicate evaluation and verification are required for this part.
- CI Workflow
- Level 3 (Binary Memory Corruption Tracking) of the CC Constant-Time Audit workflow performs tests using Valgrind in Unix environments. However, I do not have a significant idea for this part yet, so it is temporarily disabled. If you have any good ideas regarding this, please let us know.

# Contact

You can contact us in any way regarding the above content (with the exception of specific items).

You can use email <qtfelix@qu4nt.space> or Discord `qtfelix`.
45 changes: 30 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
[workspace]
members = ["internal/*", "crypto/*"]
members = ["internal/*", "crypto/*", "core/*"]
resolver = "2"

[workspace.package]
version = "1.1.2-Alpha"
version = "1.1.2"
edition = "2024"
authors = ["Q. T. Felix <qtfelix@qu4nt.space>"]
license = "MIT LICENSE"

[profile.release]
strip = true
#strip = true
# 패닉 발생 시 스택 풀기를 비활성화하여 메모리 상태가
# 외부에 노출되거나 조작될 가능성을 차단할 필요 있음
#panic = "abort"
#lto = true
#codegen-units = 1
#strip = true

[profile.dev]
panic = "abort"

[workspace.dependencies]
### INTERNAL CORE DEPENDENCIES ###
entlib-native-ffi = { path = "./internal/ffi", version = "1.1.2-Alpha" }
entlib-native-quantum-util = { path = "./internal/quantum-util", version = "1.1.2-Alpha" }
### EXTERNAL DEPENDENCIES ###
tokio = { version = "1", features = ["rt", "process"] }
### INTERNAL DEPENDENCIES ###
entlib-native-ffi = { path = "internal/ffi", version = "1.1.2" }
entlib-native-quantum-util = { path = "internal/quantum-util", version = "1.1.2" }
### CORE DEPENDENCIES ###
entlib-native-hex = { path = "core/hex", version = "1.1.2" }
entlib-native-result = { path = "core/result", version = "1.1.2" }
entlib-native-base64 = { path = "core/base64", version = "1.1.2" }
entlib-native-secure-buffer = { path = "core/secure-buffer", version = "1.1.2" }
entlib-native-constant-time = { path = "core/constant-time", version = "1.1.2" }
### INTERNAL CRYPTO DEPENDENCIES ###
entlib-native-base64 = { path = "./crypto/base64", version = "1.1.2-Alpha" }
entlib-native-constant-time = { path = "./crypto/constant-time", version = "1.1.2-Alpha" }
entlib-native-core-secure = { path = "./crypto/core-secure", version = "1.1.2-Alpha" }
entlib-native-rng = { path = "./crypto/rng", version = "1.1.2-Alpha" }
entlib-native-sha2 = { path = "./crypto/sha2", version = "1.1.2-Alpha" }
entlib-native-sha3 = { path = "./crypto/sha3", version = "1.1.2-Alpha" }
entlib-native-chacha20 = { path = "./crypto/chacha20", version = "1.1.2-Alpha" }
entlib-native-rng = { path = "crypto/rng", version = "1.1.2" }
entlib-native-tls = { path = "crypto/tls", version = "1.1.2" }
entlib-native-hkdf = { path = "crypto/hkdf", version = "1.1.2" }
entlib-native-hmac = { path = "crypto/hmac", version = "1.1.2" }
entlib-native-sha2 = { path = "crypto/sha2", version = "1.1.2" }
entlib-native-sha3 = { path = "crypto/sha3", version = "1.1.2" }
entlib-native-chacha20 = { path = "crypto/chacha20", version = "1.1.2" }
entlib-native-key-establishment = { path = "crypto/key-establishment", version = "1.1.2" }
entlib-native-digital-signature = { path = "crypto/digital-signature", version = "1.1.2" }
Loading
Loading