aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2019-04-08 15:08:17 -0400
committerGitHub <noreply@github.com>2019-04-08 15:08:17 -0400
commit2a6400716c1e17b65507cd2a433192f81cd402df (patch)
treeeb034ad74fab1e337b422d387e8e9a8b62bfb098 /javascript
parentfcfa5f12a4cd482973fdf03000af4a26a360dc2e (diff)
parent709687a7b56d6768831766459940b6f0bb078d85 (diff)
Merge branch 'master' into poljar/python-sas
Diffstat (limited to 'javascript')
-rw-r--r--javascript/olm_sas.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/javascript/olm_sas.js b/javascript/olm_sas.js
index d5044ce..a2f82ee 100644
--- a/javascript/olm_sas.js
+++ b/javascript/olm_sas.js
@@ -75,3 +75,19 @@ SAS.prototype['calculate_mac'] = restore_stack(function(input, info) {
);
return Pointer_stringify(mac_buffer);
});
+
+SAS.prototype['calculate_mac_long_kdf'] = restore_stack(function(input, info) {
+ var input_array = array_from_string(input);
+ var input_buffer = stack(input_array);
+ var info_array = array_from_string(info);
+ var info_buffer = stack(info_array);
+ var mac_length = sas_method(Module['_olm_sas_mac_length'])(this.ptr);
+ var mac_buffer = stack(mac_length + NULL_BYTE_PADDING_LENGTH);
+ sas_method(Module['_olm_sas_calculate_mac_long_kdf'])(
+ this.ptr,
+ input_buffer, input_array.length,
+ info_buffer, info_array.length,
+ mac_buffer, mac_length
+ );
+ return Pointer_stringify(mac_buffer);
+});