Skip to content

Implement the per ssrc key derivation algorithm and add computed test vectors#207

Open
aronrosenberg wants to merge 5 commits into
sframe-wg:mainfrom
aronrosenberg:main
Open

Implement the per ssrc key derivation algorithm and add computed test vectors#207
aronrosenberg wants to merge 5 commits into
sframe-wg:mainfrom
aronrosenberg:main

Conversation

@aronrosenberg
Copy link
Copy Markdown
Contributor

The test vectors have been verified with two other implementations in different languages.

@youennf youennf requested a review from bifurcation April 7, 2026 16:46
Copy link
Copy Markdown
Collaborator

@bifurcation bifurcation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor rearrangement needed, but overall this looks sound.

use hmac::SimpleHmac;
use sha2::{Sha256, Sha512};

/// Derive the per-SSRC stream key for a given SFrame cipher suite.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that this scheme is defined in Section 7 of draft-ietf-avtcore-rtp-sframe. I initially thought it was something from RFC 9605.

Comment thread reference-implementation/src/per_ssrc_key_derivation.rs Outdated
Comment on lines +1 to +3
// Test harness for SFrame per-SSRC stream key derivation vectors.
// Loads per-ssrc-key-derivation.json from the project's test-vectors directory
// and verifies that the Rust implementation produces identical keys.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should go in a new module in examples/test_vectors.rs, and follow the new/verify pattern there. Following that pattern will also get you an MD file you can include in the AVTCORE spec.

Co-authored-by: Richard Barnes <rlb@ipv.sx>
Comment thread reference-implementation/src/per_ssrc_key_derivation.rs Outdated
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.

2 participants