perf: centralized and memoized AES-256-GCM cryptographic helper library (#51)#71
Conversation
|
@prakshithamalla-art is attempting to deploy a commit to the Deekshith Gowda HS's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 45 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #51
🎯 Overview & Motivation
The processing workflows for runtime secrets and application credentials relied on scattered local crypto instances or lacked clear key error verification bounds. This resulted in redundant memory allocation during heavy sandbox synchronization loops.
This PR centralizes the application's cryptographic infrastructure inside a singular utility file (
lib/crypto.ts) using high-performance symmetricaes-256-gcmalgorithms, while adding dynamic allocation caching for the key buffers.🛠️ Changes Implemented
lib/crypto.ts.cachedKeyBuffermemoization variables to eliminate repetitiveBuffer.fromstring evaluations on hot execution paths.iv:authTag:encryptedData) with strict runtime validations forENCRYPTION_KEYavailability.