Skip to content

Conversation

reaperhulk
Copy link
Member

This PR was done via zed+claude sonnet 4 (with some cleanup and additions) using the following prompt:

Please implement HKDF in rust. You can follow the example in hmac.rs to see similar structure, but implement the general HKDF algorithm as seen in hkdf.py

@alex
Copy link
Member

alex commented May 30, 2025

(you've got failing tests)

reaperhulk and others added 5 commits June 12, 2025 20:38
This PR was done via zed+claude sonnet 4 (with some cleanup and
additions) using the following prompt:

Please implement HKDF in rust. You can follow the example in hmac.rs
to see similar structure, but implement the general HKDF algorithm
as seen in hkdf.py
Comment on lines 11 to 12
use pyo3::prelude::PyAnyMethods;
use pyo3::types::PyBytesMethods;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
use pyo3::prelude::PyAnyMethods;
use pyo3::types::PyBytesMethods;
use pyo3::types::{PyAnyMethods, PyBytesMethods};

Comment on lines 547 to 548
if actual_bytes.len() != expected_bytes.len()
|| !openssl::memcmp::eq(actual_bytes, expected_bytes)
Copy link
Member

Choose a reason for hiding this comment

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

there's a utility function for this.

Comment on lines 667 to 669
if actual_bytes.len() != expected_bytes.len()
|| !openssl::memcmp::eq(actual_bytes, expected_bytes)
{
Copy link
Member

Choose a reason for hiding this comment

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

same

@alex alex merged commit 94fd118 into pyca:main Jun 14, 2025
64 checks passed
@reaperhulk reaperhulk deleted the hkdf-speed-2 branch June 14, 2025 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants