diff --git a/src/core/operations/JSONToArrayBuffer.mjs b/src/core/operations/JSONToArrayBuffer.mjs index 09c21582..4e1c41de 100644 --- a/src/core/operations/JSONToArrayBuffer.mjs +++ b/src/core/operations/JSONToArrayBuffer.mjs @@ -1,5 +1,7 @@ /** - * @author Configured Things Ltd. [getconfigured@configuredthings.com] + * @file Developed by {@link https://configuredthings.com Configured Things} with funding from the {@link https://www.ukri.org UKRI} + * {@link https://www.dsbd.tech Digital Security by Design} program. + * @author Configured Things Ltd. * @copyright Crown Copyright 2025 * @license Apache-2.0 */ diff --git a/src/core/operations/LibHydrogenCurve25519Sign.mjs b/src/core/operations/LibHydrogenCurve25519Sign.mjs index c58b4a99..7b5ea53c 100644 --- a/src/core/operations/LibHydrogenCurve25519Sign.mjs +++ b/src/core/operations/LibHydrogenCurve25519Sign.mjs @@ -1,5 +1,7 @@ /** - * @author Configured Things Ltd. [getconfigured@configuredthings.com] + * @file Developed by {@link https://configuredthings.com Configured Things} with funding from the {@link https://www.ukri.org UKRI} + * {@link https://www.dsbd.tech Digital Security by Design} program. + * @author Configured Things Ltd. * @copyright Crown Copyright 2025 * @license Apache-2.0 */ @@ -210,6 +212,7 @@ let instance, dataview; /** * Helper function to reserve space in the buffer used * as a stack between js and the wasm. + * @private * @param {Object} offset - Must be an an object so we can update it's value * @param {number} offset.value * @param {number} length @@ -231,21 +234,22 @@ function reserve(offset, length) { } /** - * A signed JSON object. - * @typedef {Object} SignedJSON + * An object containing the signature, the ArrayBuffer used to generate the signature, and the signing operation's context + * @typedef {Object} SignedObject * @property {Uint8Array} context - A buffer representing the context used to define the context of the signing operation, see {@link https://github.com/jedisct1/libhydrogen/wiki/Contexts} - * @property {Uint8Array} input - A buffer representing the stringified JSON object used as the input to the signing operation - * @property {Uint8Array} signature - A buffer representing the digital signature of the signed JSON object - */ +* @property {Uint8Array} input - A buffer representing the stringified JSON object used as the input to the signing operation +* @property {Uint8Array} signature - A buffer representing the digital signature of the signed JSON object +*/ /** * Digital signing of an ArrayBuffer's contents + * @private * @param {ArrayBuffer} input - An ArrayBuffer to be signed * @param {string} context - A string used to define the context of the signing operation, * see {@link https://github.com/jedisct1/libhydrogen/wiki/Contexts} * @param {Uint8Array} privateKey - The private key to use for the digital signing operation - * @returns {SignedJSON} A signed JSON object + * @returns {SignedObject} An object containing the signature, the ArrayBuffer used to generate the signature, and the signing operation's context */ async function sign(input, context, privateKey) { // Importing libhydrogen's signing keygen and signing and verification functions diff --git a/src/core/operations/MQTTPublish.mjs b/src/core/operations/MQTTPublish.mjs index bf9751ee..fdabf119 100644 --- a/src/core/operations/MQTTPublish.mjs +++ b/src/core/operations/MQTTPublish.mjs @@ -1,5 +1,7 @@ /** - * @author Configured Things Ltd. [getconfigured@configuredthings.com] + * @file Developed by {@link https://configuredthings.com Configured Things} with funding from the {@link https://www.ukri.org UKRI} + * {@link https://www.dsbd.tech Digital Security by Design} program. + * @author Configured Things Ltd. * @copyright Crown Copyright 2025 * @license Apache-2.0 */ diff --git a/src/core/operations/SignedJSONToArrayBuffer.mjs b/src/core/operations/SignedObjectToArrayBuffer.mjs similarity index 68% rename from src/core/operations/SignedJSONToArrayBuffer.mjs rename to src/core/operations/SignedObjectToArrayBuffer.mjs index 87d61a9d..35a1fd98 100644 --- a/src/core/operations/SignedJSONToArrayBuffer.mjs +++ b/src/core/operations/SignedObjectToArrayBuffer.mjs @@ -1,5 +1,7 @@ /** - * @author Configured Things Ltd. [getconfigured@configuredthings.com] + * @file Developed by {@link https://configuredthings.com Configured Things} with funding from the {@link https://www.ukri.org UKRI} + * {@link https://www.dsbd.tech Digital Security by Design} program. + * @author Configured Things Ltd. * @copyright Crown Copyright 2025 * @license Apache-2.0 */ @@ -8,9 +10,9 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; /** - * Configured Things - Digital Security by Design - Signed JSON to Text operation + * Signed Object to ArrayBuffer operation */ -class SignedJSONToArrayBuffer extends Operation { +class SignedObjectToArrayBuffer extends Operation { /** * SignedJSONToArrayBuffer constructor @@ -18,9 +20,9 @@ class SignedJSONToArrayBuffer extends Operation { constructor() { super(); - this.name = "Signed JSON to ArrayBuffer"; + this.name = "Signed Object to ArrayBuffer"; this.module = "Default"; - this.description = "Converts signed JSON to text"; + this.description = "Converts a digitally signed object created by, for example, the 'LibHydrogen Curve25519 Sign' operation to an ArrayBuffer"; this.infoURL = ""; // Usually a Wikipedia link. Remember to remove localisation (i.e. https://wikipedia.org/etc rather than https://en.wikipedia.org/etc) this.inputType = "JSON"; this.outputType = "ArrayBuffer"; @@ -49,4 +51,4 @@ class SignedJSONToArrayBuffer extends Operation { } } -export default SignedJSONToArrayBuffer; +export default SignedObjectToArrayBuffer;