Skip to content

Add support for additional data (AD) in Sel.SecretKey.Stream#183

Merged
Kleidukos merged 3 commits intohaskell-cryptography:mainfrom
intricate:support-aad-secretstream-sel
Mar 21, 2025
Merged

Add support for additional data (AD) in Sel.SecretKey.Stream#183
Kleidukos merged 3 commits intohaskell-cryptography:mainfrom
intricate:support-aad-secretstream-sel

Conversation

@intricate
Copy link
Copy Markdown
Contributor

Add support for specifying AAD in Sel.SecretKey.Stream.

Comment on lines +515 to +520
additionalDataFromHexByteString
:: Base16 StrictByteString
-> Either AdditionalDataHexDecodingError AdditionalData
additionalDataFromHexByteString hexBs =
case Base16.decodeBase16Untyped (Base16.extractBase16 hexBs) of
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This pattern of calling decodeBase16Untyped . extractBase16 instead of decodeBase16 on a Base16 a value confuses me a bit (#144 (comment)), but I've done this here to be consistent with similar functions in this module.

, MessageTag (..)

-- ** Additional data (AD)
, AdditionalData (..)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thoughts on me exposing this constructor? Or would you prefer a function like additionalDataFromBinary or something like that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the constructor is not needed to use the API and would just be used for access, then you can just expose additionalDataFromBinary indeed. :)

@intricate intricate force-pushed the support-aad-secretstream-sel branch from 7238194 to dbc8aa6 Compare February 20, 2025 01:16
@Kleidukos Kleidukos self-requested a review February 20, 2025 08:43
@Kleidukos
Copy link
Copy Markdown
Member

@intricate Thanks! I'll take time to review and think about your comment in #144 :)

@intricate intricate force-pushed the support-aad-secretstream-sel branch 2 times, most recently from 3d619d4 to 3c7c6ca Compare February 20, 2025 14:22
@intricate intricate force-pushed the support-aad-secretstream-sel branch from 3c7c6ca to 3c5c401 Compare March 21, 2025 15:48
Copy link
Copy Markdown
Member

@Kleidukos Kleidukos left a comment

Choose a reason for hiding this comment

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

You're missing a changelog entry and we'll be good!

@intricate intricate force-pushed the support-aad-secretstream-sel branch from f25e7f4 to 5ed8716 Compare March 21, 2025 21:10
@intricate intricate requested a review from Kleidukos March 21, 2025 21:10
Copy link
Copy Markdown
Member

@Kleidukos Kleidukos left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@Kleidukos Kleidukos merged commit 1d86e29 into haskell-cryptography:main Mar 21, 2025
15 checks passed
@intricate intricate deleted the support-aad-secretstream-sel branch March 21, 2025 22:32
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