From 39080cd457bd425518e529c87f147c2eb4149974 Mon Sep 17 00:00:00 2001 From: Udara Pathum <46132469+hwupathum@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:21:07 +0530 Subject: [PATCH] Update method descriptions --- ballerina/hpke.bal | 8 ++++---- ballerina/kdf.bal | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ballerina/hpke.bal b/ballerina/hpke.bal index 907720ea..729641fe 100644 --- a/ballerina/hpke.bal +++ b/ballerina/hpke.bal @@ -26,7 +26,7 @@ public type HybridEncryptionResult record {| byte[] cipherText; |}; -# Returns the ML-KEM-768-HPKE-encrypted value for the given data. +# Returns the ML-KEM-768-AES-hybrid-encrypted value for the given data. # ```ballerina # string input = "Hello Ballerina"; # byte[] data = input.toBytes(); @@ -52,7 +52,7 @@ public isolated function encryptMlKem768Hpke(byte[] input, PublicKey publicKey, }; } -# Returns the ML-KEM-768-HPKE-decrypted value for the given encrypted data. +# Returns the ML-KEM-768-AES-hybrid-encrypted value for the given encrypted data. # ```ballerina # string input = "Hello Ballerina"; # byte[] data = input.toBytes(); @@ -78,7 +78,7 @@ public isolated function decryptMlKem768Hpke(byte[] input, byte[] encapsulatedKe return check decryptAesEcb(input, key); } -# Returns the RSA-ML-KEM-768-HPKE-encrypted value for the given data. +# Returns the RSA-KEM-ML-KEM-768-AES-hybrid-encrypted value for the given data. # ```ballerina # string input = "Hello Ballerina"; # byte[] data = input.toBytes(); @@ -109,7 +109,7 @@ public isolated function encryptRsaKemMlKem768Hpke(byte[] input, PublicKey rsaPu }; } -# Returns the RSA-ML-KEM-768-HPKE-decrypted value for the given encrypted data. +# Returns the RSA-KEM-ML-KEM-768-AES-hybrid-encrypted value for the given encrypted data. # ```ballerina # string input = "Hello Ballerina"; # byte[] data = input.toBytes(); diff --git a/ballerina/kdf.bal b/ballerina/kdf.bal index 648096bd..9ad25fca 100644 --- a/ballerina/kdf.bal +++ b/ballerina/kdf.bal @@ -17,7 +17,11 @@ import ballerina/jballerina.java; # Returns HKDF (HMAC-based Key Derivation Function) using SHA-256 as the hash function. -# +# ```ballerina +# string secret = "some-secret"; +# byte[] key = secret.toBytes(); +# byte[] hash = crypto:hkdfSha256(key, 32); +# ``` # + input - The input key material to derive the key from # + length - The length of the output keying material (OKM) in bytes # + salt - Optional salt value, a non-secret random value