autosar-e2e
A Rust implementation of the AUTOSAR E2E (End-to-End) Protection Protocol.
Overview
This library implements the AUTOSAR E2E protection mechanism which provides end-to-end data protection for safety-critical automotive communication systems. The E2E protection helps detect:
- Data Corruption: Through CRC checksums
- Message Loss/Duplication: Through sequence counters
- Incorrect Addressing: Through Data ID verification
Features
- Profile 11 implementation (variants 11A and 11C)
- Profile 22 implementation
- Profile 4 implementation
- Profile 5 implementation
- Profile 6 implementation
- Profile 7 implementation
- Profile 8 implementation
- Support for Protect, Check operations
- Comprehensive documentation and tests
- Configurable parameters per AUTOSAR specification
Installation
Add this to your Cargo.toml:
[]
= "0.4.0"
Usage
Basic Example
use ;
use ;
Architecture
The library follows a trait-based design for extensibility:
This design allows for easy addition of other E2E profiles in the future.
Testing
Run the test suite:
Run tests with coverage:
Safety and Correctness
- All CRC calculations use the standard
crccrate with AUTOSAR polynomial - Counter wrap-around is handled correctly
- Comprehensive test coverage including edge cases
- No unsafe code
Future Work
- Add Profile 4m support
- Add Profile 7m support
- Performance benchmarks
- Async support
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is dual-licensed under either:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
References
Disclaimer
This is an independent implementation and is not officially affiliated with or endorsed by AUTOSAR.