Requirements#

Bit Manipulation Requirements
status: draft
security: YES
safety: ASIL_B
tags: requirements, bitmanipulation

Functional Requirements#

Support for Bit Manipulation Utilities
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Functional

The bit manipulation component shall provide API for setting, clearing, toggling, and checking bits, as well as extracting bytes and manipulating half-bytes and bytes for any integral type up to 64 bits.

Support for Bitmask Operators for Enum Classes
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Functional

The bit manipulation library shall provide type-safe bitmask operations for scoped enumeration types.

Bounds and Safety Checks
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Functional

All bit manipulation functions shall validate input parameters and prevent data corruption.

Non-Functional Requirements#

Header-only API
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Non-Functional

The bit manipulation API shall be header-only and not require external dependencies.

Assumptions of Use (AoU)#

Valid Bit Positions and Ranges
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Functional

The user shall assume that the API performs bound checking to validate bit positions and ranges provided to the bit manipulation functions.

Integral Type Constraints
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Functional

The user shall only use bit manipulation functions with integral types (integers, enumerations) as specified in the library’s type constraints. Operations on floating-point or non-integral types are not supported.

Enum Class Type Safety
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Functional

The user shall use scoped enumeration types (enum class) whose enumerators are defined as non-zero power-of-two values (1, 2, 4, 8, 16, etc.)

No Side Effects on Concurrent Access
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Non-Functional

The user shall implement external synchronization mechanisms (e.g., mutexes, atomic operations, or locks) when accessing or modifying the same integral value from multiple threads concurrently, as the library provides no internal thread safety guarantees.

Bit Extraction Index Validation
status: valid
security: NO
safety: ASIL_B
tags: baselibs
reqtype: Functional

The user shall validate byte and half-byte extraction indices to ensure they correspond to valid positions within the target integral type to prevent accessing invalid memory ranges.