Skip to content
/ zuc Public
generated from Nugine/rust-template

Add crate-level doctests showcasing ZUC usage#33

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/update-docs-examples
Draft

Add crate-level doctests showcasing ZUC usage#33
Copilot wants to merge 3 commits intomainfrom
copilot/update-docs-examples

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

The docs lacked concrete examples for ZUC usage, making it harder to adopt.

  • Documentation
    • Added crate-level doctests demonstrating ZUC128 stream cipher encryption/decryption.
    • Added doctest for computing a 128-EIA3 integrity tag.

Example:

use cipher::{KeyIvInit, StreamCipher};
use zuc::zuc128::Zuc128StreamCipher;

let key = cipher::Key::<Zuc128StreamCipher>::from_slice(&[0u8; 16]);
let iv = cipher::Iv::<Zuc128StreamCipher>::from_slice(&[0u8; 16]);
let mut data = *b"hello world 123";

let mut cipher = Zuc128StreamCipher::new(key, iv);
cipher.apply_keystream(&mut data);        // encrypt
let mut cipher = Zuc128StreamCipher::new(key, iv);
cipher.apply_keystream(&mut data);        // decrypt
assert_eq!(&data, b"hello world 123");
Original prompt

This section details on the original issue you should resolve

<issue_title>docs examples</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation examples Add crate-level doctests showcasing ZUC usage Dec 25, 2025
Copilot AI requested a review from Nugine December 25, 2025 14:34
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.81%. Comparing base (eaa8fad) to head (6c76894).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #33   +/-   ##
=======================================
  Coverage   86.81%   86.81%           
=======================================
  Files          12       12           
  Lines         713      713           
  Branches      713      713           
=======================================
  Hits          619      619           
  Misses         89       89           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs examples

2 participants