Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

24 changes: 17 additions & 7 deletions .idea/entlib-native.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[workspace]
members = ["core/*", "crypto/*"]
members = ["internal/*", "crypto/*"]
resolver = "2"

[workspace.package]
version = "1.1.1-Alpha3"
version = "1.1.2-Alpha"
edition = "2024"
authors = ["Q. T. Felix <qtfelix@qu4nt.space>"]
license = "MIT LICENSE"
Expand All @@ -12,8 +12,13 @@ license = "MIT LICENSE"
strip = true

[workspace.dependencies]
entlib-native-helper = { path = "./core/helper", version = "1.1.1-Alpha3" }
entlib-native-ffi = { path = "./core/ffi", version = "1.1.1-Alpha3" }
entlib-native-sha2 = { path = "./crypto/sha2", version = "1.1.1-Alpha3" }
entlib-native-sha3 = { path = "./crypto/sha3", version = "1.1.1-Alpha3" }
entlib-native-rng = { path = "./crypto/rng", version = "1.1.1-Alpha3" }
### 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" }
### 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" }
22 changes: 1 addition & 21 deletions INTRODUCTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,4 @@

# 구성

네이티브는 가상 매니페스트(virtual manifest) 기반의 워크스페이스로 구성되며, 각 크레이트는 명확한 책임 경계를 가집니다.

## core/helper

`no_std` 환경에서 동작하는 보안 원시 연산 모듈입니다. 상수 시간 비교 및 선택 연산(`ConstantTimeOps` 트레이트), 아키텍처별 인라인 어셈블리 구현(`CtPrimitive` 트레이트), 상수 시간 `Base64` 인코딩/디코딩, 그리고 `SecureBuffer`를 제공합니다. 네이티브의 다른 모든 크레이트가 의존하는 기반 계층입니다.

## core/ffi

Java 측 FFM API와 직접 맞닿는 C ABI 브릿지 계층입니다. `Base64` 인/디코딩 FFI 엔드포인트(`entlib_b64_encode_secure`, `entlib_b64_decode_secure`)와 메모리 소거 엔드포인트(`entanglement_secure_wipe`), `SecureBuffer`의 포인터 추출 및 해제 함수를 제공합니다. 모든 진입점에서 `null` 포인터 검증과 오버플로 보호를 수행합니다.

## crypto/rng

하드웨어 기반 난수 생성 모듈입니다. CPU의 `rdseed`/`rndr` 명령어를 직접 호출하는 기본 생성기(`base_rng`)와, 하드웨어 엔트로피를 ChaCha20 코어 블록으로 비선형 혼합하는 확장 생성기(`MixedRng`)를 제공합니다.

## crypto/sha2

SHA-2 계열 해시 함수 구현입니다. `SHA-224`, `SHA-256`, `SHA-384`, `SHA-512` 네 가지 변형을 제공하며, 내부 상태 구조체(`Sha256State`, `Sha512State`)는 `Drop` 트레이트를 통해 연산 완료 시 자동 소거됩니다. 메시지 스케줄 등 연산 중간의 임시 데이터 역시 휘발성 소거 후 메모리 배리어가 적용됩니다.

## crypto/sha3

SHA-3 계열 해시 함수 및 XOF(확장 출력 함수) 구현입니다. `Keccak` 스펀지 구조 위에 `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512` 고정 출력 변형과 `SHAKE128`, `SHAKE256` 가변 출력 변형을 제공합니다. 내부 상태(`KeccakState`)의 25개 64비트 레인과 200바이트 버퍼는 `Drop` 트레이트에 의해 자동 소거되며, Keccak-f[1600] 순열의 임시 상태 역시 매 호출마다 휘발성 소거됩니다.
네이티브는 가상 매니페스트(virtual manifest) 기반의 워크스페이스로 구성되며, 각 크레이트는 세분화되어 명확한 책임 경계를 가집니다. `crypto/` 하위에는 `Base64`, `Hash` 또는 알고리즘 연산을 수행하기 위한 크레이트가 위치해 있고, `internal/` 하위에는 `ffi` 연동 및 양자 관련 유틸리티 크레이트가 포함되어 있습니다.
22 changes: 1 addition & 21 deletions INTRODUCTION_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,4 @@ The reason this design is necessary is clear. Java's Garbage Collector freely co

# Composition

Native is composed of a workspace based on a virtual manifest, and each crate has clear responsibility boundaries.

## core/helper

A security primitive operation module operating in a `no_std` environment. It provides constant time comparison and selection operations (`ConstantTimeOps` trait), inline assembly implementations per architecture (`CtPrimitive` trait), constant time `Base64` encoding/decoding, and `SecureBuffer`. It is the base layer on which all other crates of Native depend.

## core/ffi

A C ABI bridge layer directly touching the Java side FFM API. It provides `Base64` encoding/decoding FFI endpoints (`entlib_b64_encode_secure`, `entlib_b64_decode_secure`), memory erasure endpoint (`entanglement_secure_wipe`), and pointer extraction and release functions of `SecureBuffer`. It performs null pointer verification and overflow protection at all entry points.

## crypto/rng

A hardware-based random number generation module. It provides a basic generator (`base_rng`) that directly calls the CPU's `rdseed`/`rndr` instructions, and an extended generator (`MixedRng`) that non-linearly mixes hardware entropy with the ChaCha20 core block.

## crypto/sha2

Implementation of SHA-2 family hash functions. It provides four variants: `SHA-224`, `SHA-256`, `SHA-384`, `SHA-512`, and internal state structures (`Sha256State`, `Sha512State`) are automatically erased upon operation completion via the `Drop` trait. Temporary data during operations such as message schedules are also volatilely erased, and then memory barriers are applied.

## crypto/sha3

Implementation of SHA-3 family hash functions and XOF (Extendable Output Functions). It provides `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512` fixed output variants and `SHAKE128`, `SHAKE256` variable output variants on top of the `Keccak` sponge structure. The 25 64-bit lanes and 200-byte buffer of the internal state (`KeccakState`) are automatically erased by the `Drop` trait, and the temporary state of the Keccak-f[1600] permutation is also volatilely erased at every call.
Native is composed of a virtual manifest-based workspace, and each crate is granularized to have clear responsibility boundaries. Under `crypto/`, crates for performing `Base64`, `Hash`, or algorithm operations are located, and under `internal/`, crates for `ffi` integration and quantum-related utilities are included.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Alpha 버전

이 네이티브 라이브러리는 `1.1.0` 릴리즈 출시에 대한 준비를 마쳐도 곧바로 출시되진 않습니다. 이에 세밀하고 또 정밀하게 코드를 검토하고, 그 환경을 원활히 구축하기 위해 지금 이 시점에서 알파 버전으로 우선 공개하겠습니다.
이 네이티브 라이브러리는 `1.1.x` 릴리즈 출시에 대한 준비를 마쳐도 곧바로 출시되진 않습니다. 이에 세밀하고 또 정밀하게 코드를 검토하고, 그 환경을 원활히 구축하기 위해 지금 이 시점에서 알파 버전으로 우선 공개하겠습니다.

# 벤치마킹

Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Just in time, the respected security organization `Legion of the BouncyCastle In

# Alpha Version

This native library will not be released immediately even if preparations for the `1.1.0` release are completed. Therefore, to review the code in detail and precisely, and to smoothly build that environment, I will first release it as an alpha version at this point.
This native library will not be released immediately even if preparations for the `1.1.x` release are completed. Therefore, to review the code in detail and precisely, and to smoothly build that environment, I will first release it as an alpha version at this point.

# Benchmarking

Expand Down
154 changes: 0 additions & 154 deletions core/ffi/benches/ffi_base64_bench.rs

This file was deleted.

37 changes: 0 additions & 37 deletions core/ffi/benches/ffi_wipe_bench.rs

This file was deleted.

Loading