Skip to content

Add minimal buffer encrypt and decrypt example for AES-GCM#562

Merged
tmael merged 1 commit intowolfSSL:masterfrom
padelsbach:aes256-gcm-minimal
Mar 12, 2026
Merged

Add minimal buffer encrypt and decrypt example for AES-GCM#562
tmael merged 1 commit intowolfSSL:masterfrom
padelsbach:aes256-gcm-minimal

Conversation

@padelsbach
Copy link
Contributor

No description provided.

@padelsbach padelsbach requested a review from tmael March 9, 2026 21:06
@padelsbach padelsbach marked this pull request as ready for review March 11, 2026 21:08
@padelsbach padelsbach requested a review from tmael March 11, 2026 21:28
Copy link
Contributor

@tmael tmael left a comment

Choose a reason for hiding this comment

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

Good example. You should probably print the ciphertext and authentication tag, similar to the following output:

$ ./aesgcm-oneshot 
Encrypt with AES128-GCM
 Plaintext: 090909090909090909090909090909090909090909090909090909090909090909
Ciphertext: 6ce876da0652d9e02ddb344429b268342d1d30868515ebbdf15eab20359fb10d84
  Auth Tag: 625191be5c1900b389c53c720a9236c6
Decrypt with AES128-GCM
 Decrypted: 090909090909090909090909090909090909090909090909090909090909090909

@tmael tmael assigned padelsbach and unassigned tmael Mar 11, 2026
@padelsbach padelsbach requested a review from tmael March 11, 2026 22:00
Copy link
Contributor

@tmael tmael left a comment

Choose a reason for hiding this comment

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

Looks good. One more. missing underscore in __attribute__((target("rdseed")))

Copy link
Contributor

@tmael tmael left a comment

Choose a reason for hiding this comment

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

Thanks @padelsbach! Looks good.

@tmael tmael merged commit 498d78e into wolfSSL:master Mar 12, 2026

/* Optional setup path: seed wolfSSL RNG via RDSEED when available. */
#if defined(__x86_64__)
#define RDSEED_ENABLED 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: The user needs WC_RNG_SEED_CB to use rdseed as well.

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