added funding credit UKRI DSbD

This commit is contained in:
Simon Arnell 2025-01-31 16:32:39 +02:00
parent ba9127c9c8
commit 557d0b7567
4 changed files with 25 additions and 15 deletions

View file

@ -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. <getconfigured@configuredthings.com>
* @copyright Crown Copyright 2025 * @copyright Crown Copyright 2025
* @license Apache-2.0 * @license Apache-2.0
*/ */

View file

@ -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. <getconfigured@configuredthings.com>
* @copyright Crown Copyright 2025 * @copyright Crown Copyright 2025
* @license Apache-2.0 * @license Apache-2.0
*/ */
@ -210,6 +212,7 @@ let instance, dataview;
/** /**
* Helper function to reserve space in the buffer used * Helper function to reserve space in the buffer used
* as a stack between js and the wasm. * 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 {Object} offset - Must be an an object so we can update it's value
* @param {number} offset.value * @param {number} offset.value
* @param {number} length * @param {number} length
@ -231,8 +234,8 @@ function reserve(offset, length) {
} }
/** /**
* A signed JSON object. * An object containing the signature, the ArrayBuffer used to generate the signature, and the signing operation's context
* @typedef {Object} SignedJSON * @typedef {Object} SignedObject
* @property {Uint8Array} context - A buffer representing the context used to define the context of the signing operation, * @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} 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} input - A buffer representing the stringified JSON object used as the input to the signing operation
@ -241,11 +244,12 @@ function reserve(offset, length) {
/** /**
* Digital signing of an ArrayBuffer's contents * Digital signing of an ArrayBuffer's contents
* @private
* @param {ArrayBuffer} input - An ArrayBuffer to be signed * @param {ArrayBuffer} input - An ArrayBuffer to be signed
* @param {string} context - A string used to define the context of the signing operation, * @param {string} context - A string used to define the context of the signing operation,
* see {@link https://github.com/jedisct1/libhydrogen/wiki/Contexts} * see {@link https://github.com/jedisct1/libhydrogen/wiki/Contexts}
* @param {Uint8Array} privateKey - The private key to use for the digital signing operation * @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) { async function sign(input, context, privateKey) {
// Importing libhydrogen's signing keygen and signing and verification functions // Importing libhydrogen's signing keygen and signing and verification functions

View file

@ -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. <getconfigured@configuredthings.com>
* @copyright Crown Copyright 2025 * @copyright Crown Copyright 2025
* @license Apache-2.0 * @license Apache-2.0
*/ */

View file

@ -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. <getconfigured@configuredthings.com>
* @copyright Crown Copyright 2025 * @copyright Crown Copyright 2025
* @license Apache-2.0 * @license Apache-2.0
*/ */
@ -8,9 +10,9 @@ import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.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 * SignedJSONToArrayBuffer constructor
@ -18,9 +20,9 @@ class SignedJSONToArrayBuffer extends Operation {
constructor() { constructor() {
super(); super();
this.name = "Signed JSON to ArrayBuffer"; this.name = "Signed Object to ArrayBuffer";
this.module = "Default"; 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.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.inputType = "JSON";
this.outputType = "ArrayBuffer"; this.outputType = "ArrayBuffer";
@ -49,4 +51,4 @@ class SignedJSONToArrayBuffer extends Operation {
} }
} }
export default SignedJSONToArrayBuffer; export default SignedObjectToArrayBuffer;