hpke 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["hpke_dispatch.js", "index.ts"],
4
- "sourcesContent": ["let imports = {};\nimports['__wbindgen_placeholder__'] = module.exports;\nlet wasm;\nconst { TextDecoder } = require(`util`);\n\nconst heap = new Array(32).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachegetUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {\n cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachegetUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1);\n getUint8Memory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nlet cachegetInt32Memory0 = null;\nfunction getInt32Memory0() {\n if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {\n cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachegetInt32Memory0;\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n*\n*`base_mode_open` provides an interface to [`hpke::single_shot_open`]\n*that does not require compile time selection of an algorithm. Instead,\n*the selected algorithm is provided through the [`Config`] passed as\n*the first argument.\n*\n*Requires the `base-mode-open` crate feature to be enabled.\n*\n*# Errors\n*\n*This will return an `Result::Err` variant if:\n*\n** we are unable to deserialize the private key or encapsulated key\n** there is an error in key decapsulation\n** there is an error in decryption\n*\n* @param {Config} config\n* @param {Uint8Array} private_key\n* @param {Uint8Array} encapped_key\n* @param {Uint8Array} info\n* @param {Uint8Array} ciphertext\n* @param {Uint8Array} aad\n* @returns {Uint8Array}\n*/\nmodule.exports.base_mode_open = function(config, private_key, encapped_key, info, ciphertext, aad) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(config, Config);\n const ptr0 = passArray8ToWasm0(private_key, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(encapped_key, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);\n const len4 = WASM_VECTOR_LEN;\n wasm.base_mode_open(retptr, config.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var r2 = getInt32Memory0()[retptr / 4 + 2];\n var r3 = getInt32Memory0()[retptr / 4 + 3];\n if (r3) {\n throw takeObject(r2);\n }\n var v5 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v5;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n};\n\n/**\n*\n*`base_mode_seal` provides an interface to [`hpke::single_shot_seal`]\n*that does not require compile time selection of an\n*algorithm. Instead, the selected algorithm is provided through the\n*[`Config`] passed as the first argument.\n*\n*Requires the `base-mode-seal` crate feature to be enabled.\n*\n*# Errors\n*\n*This will return an `Result::Err` variant if:\n*\n** we are unable to deserialize the recipient public key\n** there is an error in key encapsultion\n** there is an error in encryption\n*\n*\n* @param {Config} config\n* @param {Uint8Array} recipient_public_key\n* @param {Uint8Array} info\n* @param {Uint8Array} plaintext\n* @param {Uint8Array} aad\n* @returns {EncappedKeyAndCiphertext}\n*/\nmodule.exports.base_mode_seal = function(config, recipient_public_key, info, plaintext, aad) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(config, Config);\n const ptr0 = passArray8ToWasm0(recipient_public_key, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n wasm.base_mode_seal(retptr, config.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var r2 = getInt32Memory0()[retptr / 4 + 2];\n if (r2) {\n throw takeObject(r1);\n }\n return EncappedKeyAndCiphertext.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n};\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n/**\n*\n*Aead represents an authenticated encryption with additional data\n*encryption function, as per [RFC9180\u00A77.3](https://www.rfc-editor.org/rfc/rfc9180.html#section-7.3)\n*/\nmodule.exports.Aead = Object.freeze({\n/**\n* AES-128-GCM [GCM](https://doi.org/10.6028/nist.sp.800-38d)\n*/\nAesGcm128:1,\"1\":\"AesGcm128\",\n/**\n* AES-256-GCM [GCM](https://doi.org/10.6028/nist.sp.800-38d)\n*/\nAesGcm256:2,\"2\":\"AesGcm256\",\n/**\n* ChaCha20Poly1305 [RFC8439](https://www.rfc-editor.org/info/rfc8439)\n*/\nChaCha20Poly1305:3,\"3\":\"ChaCha20Poly1305\", });\n/**\n*\n*Kdf represents an key derivation function, as per\n*[RFC9180\u00A77.2](https://www.rfc-editor.org/rfc/rfc9180.html#section-7.2)\n*/\nmodule.exports.Kdf = Object.freeze({\n/**\n* Sha256 [RFC5869](https://www.rfc-editor.org/info/rfc5869)\n*/\nSha256:1,\"1\":\"Sha256\",\n/**\n* Sha384 [RFC5869](https://www.rfc-editor.org/info/rfc5869)\n*/\nSha384:2,\"2\":\"Sha384\",\n/**\n* Sha512 [RFC5869](https://www.rfc-editor.org/info/rfc5869)\n*/\nSha512:3,\"3\":\"Sha512\", });\n/**\n*\n*Kem represents an asymmetric key encapsulation mechanism, as per\n*[RFC9180\u00A77.1][section-7.1]. Currently only two of options listed in\n*the hpke draft are available.\n*\n*[section-7.1]: https://www.rfc-editor.org/rfc/rfc9180.html#section-7.1\n*/\nmodule.exports.Kem = Object.freeze({\n/**\n* DHKEM(P-256, HKDF-SHA256) [NISTCurves](https://doi.org/10.6028/nist.fips.186-4)\n*/\nDhP256HkdfSha256:16,\"16\":\"DhP256HkdfSha256\",\n/**\n* DHKEM(X25519, HKDF-SHA256) [RFC7748](https://www.rfc-editor.org/info/rfc7748)\n*/\nX25519HkdfSha256:32,\"32\":\"X25519HkdfSha256\", });\n/**\n*\n*Config is an open struct that contains an ([`Aead`], [`Kdf`], [`Kem`])\n*algorithmic triple. This can be used with [`Config::base_mode_seal`],\n*[`Config::base_mode_open`], [`base_mode_seal`], or [`base_mode_open`].\n*/\nclass Config {\n\n static __wrap(ptr) {\n const obj = Object.create(Config.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_config_free(ptr);\n }\n /**\n * the [authenticated encryption with additional data encryption function](crate::Aead) to be used\n */\n get aead() {\n const ret = wasm.__wbg_get_config_aead(this.ptr);\n return ret >>> 0;\n }\n /**\n * the [authenticated encryption with additional data encryption function](crate::Aead) to be used\n * @param {number} arg0\n */\n set aead(arg0) {\n wasm.__wbg_set_config_aead(this.ptr, arg0);\n }\n /**\n * the [key derivation function](crate::Kdf) to be used\n */\n get kdf() {\n const ret = wasm.__wbg_get_config_kdf(this.ptr);\n return ret >>> 0;\n }\n /**\n * the [key derivation function](crate::Kdf) to be used\n * @param {number} arg0\n */\n set kdf(arg0) {\n wasm.__wbg_set_config_kdf(this.ptr, arg0);\n }\n /**\n * the [asymmetric key encapsulation mechanism](crate::Kem) to be used\n */\n get kem() {\n const ret = wasm.__wbg_get_config_kem(this.ptr);\n return ret >>> 0;\n }\n /**\n * the [asymmetric key encapsulation mechanism](crate::Kem) to be used\n * @param {number} arg0\n */\n set kem(arg0) {\n wasm.__wbg_set_config_kem(this.ptr, arg0);\n }\n /**\n *\n * base_mode_seal provides an interface to [`hpke::single_shot_seal`] that does\n * not require compile time selection of an algorithm. Instead, the\n * selected algorithm is provided through the [`Config`] that this\n * method is called on.\n *\n * Requires the `base-mode-seal` crate feature to be enabled.\n *\n * # Errors\n *\n * This will return an `Result::Err` variant if:\n *\n * * we are unable to deserialize the recipient public key\n * * there is an error in key encapsultion\n * * there is an error in encryption\n *\n *\n * @param {Uint8Array} recipient_public_key\n * @param {Uint8Array} info\n * @param {Uint8Array} plaintext\n * @param {Uint8Array} aad\n * @returns {EncappedKeyAndCiphertext}\n */\n base_mode_seal(recipient_public_key, info, plaintext, aad) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passArray8ToWasm0(recipient_public_key, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n wasm.config_base_mode_seal(retptr, this.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var r2 = getInt32Memory0()[retptr / 4 + 2];\n if (r2) {\n throw takeObject(r1);\n }\n return EncappedKeyAndCiphertext.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n *\n * base_mode_open provides an interface to [`hpke::single_shot_open`]\n * that does not require compile time selection of an\n * algorithm. Instead, the selected algorithm is provided through the\n * [`Config`] that this method is called on.\n *\n * Requires the `base-mode-open` crate feature to be enabled.\n *\n * # Errors\n *\n * This will return an `Result::Err` variant if:\n *\n * * we are unable to deserialize the private key or encapsulated key\n * * there is an error in key decapsulation\n * * there is an error in decryption\n *\n *\n * @param {Uint8Array} private_key\n * @param {Uint8Array} encapped_key\n * @param {Uint8Array} info\n * @param {Uint8Array} ciphertext\n * @param {Uint8Array} aad\n * @returns {Uint8Array}\n */\n base_mode_open(private_key, encapped_key, info, ciphertext, aad) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passArray8ToWasm0(private_key, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(encapped_key, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n const ptr4 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);\n const len4 = WASM_VECTOR_LEN;\n wasm.config_base_mode_open(retptr, this.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var r2 = getInt32Memory0()[retptr / 4 + 2];\n var r3 = getInt32Memory0()[retptr / 4 + 3];\n if (r3) {\n throw takeObject(r2);\n }\n var v5 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v5;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Attempt to convert three u16 ids into a valid config. The id mappings are defined in the draft.\n * @param {number} aead_id\n * @param {number} kdf_id\n * @param {number} kem_id\n * @returns {Config}\n */\n static try_from_ids(aead_id, kdf_id, kem_id) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.config_try_from_ids(retptr, aead_id, kdf_id, kem_id);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var r2 = getInt32Memory0()[retptr / 4 + 2];\n if (r2) {\n throw takeObject(r1);\n }\n return Config.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n}\nmodule.exports.Config = Config;\n/**\n*\n*a simple struct to return the combined encapsulated key\n*and ciphertext from seal\n*/\nclass EncappedKeyAndCiphertext {\n\n static __wrap(ptr) {\n const obj = Object.create(EncappedKeyAndCiphertext.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_encappedkeyandciphertext_free(ptr);\n }\n /**\n * the encapsulated encryption key\n */\n get encapped_key() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.__wbg_get_encappedkeyandciphertext_encapped_key(retptr, this.ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v0 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * the encapsulated encryption key\n * @param {Uint8Array} arg0\n */\n set encapped_key(arg0) {\n const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n wasm.__wbg_set_encappedkeyandciphertext_encapped_key(this.ptr, ptr0, len0);\n }\n /**\n * the ciphertext, encrypted with the key\n */\n get ciphertext() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.__wbg_get_encappedkeyandciphertext_ciphertext(retptr, this.ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v0 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * the ciphertext, encrypted with the key\n * @param {Uint8Array} arg0\n */\n set ciphertext(arg0) {\n const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n wasm.__wbg_set_encappedkeyandciphertext_ciphertext(this.ptr, ptr0, len0);\n }\n}\nmodule.exports.EncappedKeyAndCiphertext = EncappedKeyAndCiphertext;\n/**\n*r\"\n* a newtype wrapper for HpkeError so we can use it in wasm_bindgen\n*\n*/\nclass HpkeError {\n\n static __wrap(ptr) {\n const obj = Object.create(HpkeError.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_hpkeerror_free(ptr);\n }\n}\nmodule.exports.HpkeError = HpkeError;\n/**\n*\n*A simple error type for failed id lookups\n*\n*/\nclass IdLookupError {\n\n static __wrap(ptr) {\n const obj = Object.create(IdLookupError.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_idlookuperror_free(ptr);\n }\n}\nmodule.exports.IdLookupError = IdLookupError;\n/**\n* An encoded keypair\n*/\nclass Keypair {\n\n static __wrap(ptr) {\n const obj = Object.create(Keypair.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_keypair_free(ptr);\n }\n /**\n * the public key for this keypair\n */\n get public_key() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.__wbg_get_keypair_public_key(retptr, this.ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v0 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * the public key for this keypair\n * @param {Uint8Array} arg0\n */\n set public_key(arg0) {\n const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n wasm.__wbg_set_keypair_public_key(this.ptr, ptr0, len0);\n }\n /**\n * the private key for this keypair,\n */\n get private_key() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.__wbg_get_keypair_private_key(retptr, this.ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v0 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * the private key for this keypair,\n * @param {Uint8Array} arg0\n */\n set private_key(arg0) {\n const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n wasm.__wbg_set_keypair_private_key(this.ptr, ptr0, len0);\n }\n /**\n * generate a keypair from a [`Kem`]\n * @param {number} kem\n */\n constructor(kem) {\n const ret = wasm.keypair_new(kem);\n return Keypair.__wrap(ret);\n }\n}\nmodule.exports.Keypair = Keypair;\n\nmodule.exports.__wbg_hpkeerror_new = function(arg0) {\n const ret = HpkeError.__wrap(arg0);\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_idlookuperror_new = function(arg0) {\n const ret = IdLookupError.__wrap(arg0);\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_randomFillSync_654a7797990fb8db = function() { return handleError(function (arg0, arg1, arg2) {\n getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));\n}, arguments) };\n\nmodule.exports.__wbindgen_object_drop_ref = function(arg0) {\n takeObject(arg0);\n};\n\nmodule.exports.__wbg_getRandomValues_fb6b088efb6bead2 = function() { return handleError(function (arg0, arg1) {\n getObject(arg0).getRandomValues(getObject(arg1));\n}, arguments) };\n\nmodule.exports.__wbg_process_70251ed1291754d5 = function(arg0) {\n const ret = getObject(arg0).process;\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbindgen_is_object = function(arg0) {\n const val = getObject(arg0);\n const ret = typeof(val) === 'object' && val !== null;\n return ret;\n};\n\nmodule.exports.__wbg_versions_b23f2588cdb2ddbb = function(arg0) {\n const ret = getObject(arg0).versions;\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_node_61b8c9a82499895d = function(arg0) {\n const ret = getObject(arg0).node;\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbindgen_is_string = function(arg0) {\n const ret = typeof(getObject(arg0)) === 'string';\n return ret;\n};\n\nmodule.exports.__wbg_crypto_2f56257a38275dbd = function(arg0) {\n const ret = getObject(arg0).crypto;\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_msCrypto_d07655bf62361f21 = function(arg0) {\n const ret = getObject(arg0).msCrypto;\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_static_accessor_NODE_MODULE_33b45247c55045b0 = function() {\n const ret = module;\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_require_2a93bc09fee45aca = function() { return handleError(function (arg0, arg1, arg2) {\n const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));\n return addHeapObject(ret);\n}, arguments) };\n\nmodule.exports.__wbg_newnoargs_e23b458e372830de = function(arg0, arg1) {\n const ret = new Function(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_call_ae78342adc33730a = function() { return handleError(function (arg0, arg1) {\n const ret = getObject(arg0).call(getObject(arg1));\n return addHeapObject(ret);\n}, arguments) };\n\nmodule.exports.__wbindgen_object_clone_ref = function(arg0) {\n const ret = getObject(arg0);\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_self_99737b4dcdf6f0d8 = function() { return handleError(function () {\n const ret = self.self;\n return addHeapObject(ret);\n}, arguments) };\n\nmodule.exports.__wbg_window_9b61fbbf3564c4fb = function() { return handleError(function () {\n const ret = window.window;\n return addHeapObject(ret);\n}, arguments) };\n\nmodule.exports.__wbg_globalThis_8e275ef40caea3a3 = function() { return handleError(function () {\n const ret = globalThis.globalThis;\n return addHeapObject(ret);\n}, arguments) };\n\nmodule.exports.__wbg_global_5de1e0f82bddcd27 = function() { return handleError(function () {\n const ret = global.global;\n return addHeapObject(ret);\n}, arguments) };\n\nmodule.exports.__wbindgen_is_undefined = function(arg0) {\n const ret = getObject(arg0) === undefined;\n return ret;\n};\n\nmodule.exports.__wbg_buffer_7af23f65f6c64548 = function(arg0) {\n const ret = getObject(arg0).buffer;\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_new_cc9018bd6f283b6f = function(arg0) {\n const ret = new Uint8Array(getObject(arg0));\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {\n getObject(arg0).set(getObject(arg1), arg2 >>> 0);\n};\n\nmodule.exports.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {\n const ret = getObject(arg0).length;\n return ret;\n};\n\nmodule.exports.__wbg_newwithlength_8f0657faca9f1422 = function(arg0) {\n const ret = new Uint8Array(arg0 >>> 0);\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbg_subarray_da527dbd24eafb6b = function(arg0, arg1, arg2) {\n const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);\n return addHeapObject(ret);\n};\n\nmodule.exports.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\nmodule.exports.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return addHeapObject(ret);\n};\n\n", "import wasm from \"./hpke_dispatch_bg.wasm\";\nimport init from \"./hpke_dispatch.js\";\n//this is exported so it doesn't get dead-code-eliminated\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nexport const __wasm = init(wasm);\nexport * from \"./hpke_dispatch.js\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,QAAI,UAAU,CAAC;AACf,YAAQ,8BAA8B,OAAO;AAC7C,QAAI;AACJ,QAAM,EAAE,gBAAgB,UAAQ;AAEhC,QAAM,OAAO,IAAI,MAAM,E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aAAO,cAAc,GAAG;AAAA,IAC5B;AAEA,WAAO,QAAQ,6BAA6B,SAAS,MAAM,MAAM,MAAM;AACnE,gBAAU,IAAI,EAAE,IAAI,UAAU,IAAI,GAAG,SAAS,CAAC;AAAA,IACnD;AAEA,WAAO,QAAQ,gCAAgC,SAAS,MAAM;AAC1D,YAAM,MAAM,UAAU,IAAI,EAAE;AAC5B,aAAO;AAAA,IACX;AAEA,WAAO,QAAQ,uCAAuC,SAAS,MAAM;AACjE,YAAM,MAAM,IAAI,WAAW,SAAS,CAAC;AACrC,aAAO,cAAc,GAAG;AAAA,IAC5B;AAEA,WAAO,QAAQ,kCAAkC,SAAS,MAAM,MAAM,MAAM;AACxE,YAAM,MAAM,UAAU,IAAI,EAAE,SAAS,SAAS,GAAG,SAAS,CAAC;AAC3D,aAAO,cAAc,GAAG;AAAA,IAC5B;AAEA,WAAO,QAAQ,mBAAmB,SAAS,MAAM,MAAM;AACnD,YAAM,IAAI,MAAM,mBAAmB,MAAM,IAAI,CAAC;AAAA,IAClD;AAEA,WAAO,QAAQ,oBAAoB,WAAW;AAC1C,YAAM,MAAM,KAAK;AACjB,aAAO,cAAc,GAAG;AAAA,IAC5B;AAAA;AAAA;;;ACzxBA;AAAA;AAAA;AAAA;;;;;;AACA,2BAAiB;AAIjB,yBAAc;AADP,IAAM,SAAS,kCAAK,wBAAI;",
6
- "names": []
7
- }
@@ -1,21 +0,0 @@
1
- {
2
- "name": "hpke-dispatch",
3
- "description": "runtime algorithmic selection for hybrid public key encryption",
4
- "version": "0.4.0",
5
- "license": "MPL-2.0",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/divviup/hpke-dispatch"
9
- },
10
- "files": [
11
- "hpke_dispatch_bg.wasm",
12
- "hpke_dispatch.js",
13
- "hpke_dispatch.d.ts"
14
- ],
15
- "main": "hpke_dispatch.js",
16
- "types": "hpke_dispatch.d.ts",
17
- "keywords": [
18
- "hpke",
19
- "encryption"
20
- ]
21
- }
package/pkg/node/tests.js DELETED
@@ -1,57 +0,0 @@
1
- var import_chai = require("chai");
2
- var import__ = require(".");
3
- var import_util = require("util");
4
- describe("HPKE", () => {
5
- describe("Config", () => {
6
- it("throws when the algorithms specified are invalid", () => {
7
- const [aead, kdf, kem] = [100, 100, 100];
8
- (0, import_chai.assert)(!(aead in import__.Aead));
9
- (0, import_chai.assert)(!(kdf in import__.Kdf));
10
- (0, import_chai.assert)(!(kem in import__.Kem));
11
- import_chai.assert.throws(() => import__.Config.try_from_ids(aead, kdf, kem));
12
- });
13
- });
14
- describe("Keypair", () => {
15
- it("generates a (65, 32)-byte keypair for Kem.DhP256HkdfSha256", () => {
16
- const keypair = new import__.Keypair(import__.Kem.DhP256HkdfSha256);
17
- import_chai.assert.equal(keypair.public_key.length, 65);
18
- import_chai.assert.equal(keypair.private_key.length, 32);
19
- });
20
- it("generates a (32, 32)-byte keypair for Kem.X25519HkdfSha256", () => {
21
- const keypair = new import__.Keypair(import__.Kem.X25519HkdfSha256);
22
- import_chai.assert.equal(keypair.public_key.length, 32);
23
- import_chai.assert.equal(keypair.private_key.length, 32);
24
- });
25
- it("throws when provided an invalid Kem", () => {
26
- import_chai.assert.throws(() => new import__.Keypair(1e3));
27
- });
28
- });
29
- describe("Round trips", () => {
30
- const decoder = new import_util.TextDecoder();
31
- const encoder = new import_util.TextEncoder();
32
- const startMessage = "plaintext message text";
33
- const plaintext = encoder.encode(startMessage);
34
- const info = encoder.encode("app info");
35
- const aad = encoder.encode("associated data");
36
- for (const aead of [
37
- import__.Aead.AesGcm128,
38
- import__.Aead.AesGcm256,
39
- import__.Aead.ChaCha20Poly1305
40
- ]) {
41
- for (const kdf of [import__.Kdf.Sha256, import__.Kdf.Sha384, import__.Kdf.Sha512]) {
42
- for (const kem of [import__.Kem.DhP256HkdfSha256, import__.Kem.X25519HkdfSha256]) {
43
- it(`succeeds for ${import__.Aead[aead]}, ${import__.Kdf[kdf]}, ${import__.Kem[kem]}`, () => {
44
- const config = import__.Config.try_from_ids(aead, kdf, kem);
45
- import_chai.assert.equal(config.aead, aead);
46
- import_chai.assert.equal(config.kem, kem);
47
- import_chai.assert.equal(config.kdf, kdf);
48
- const keypair = new import__.Keypair(config.kem);
49
- const keyAndCiphertext = config.base_mode_seal(keypair.public_key, info, plaintext, aad);
50
- const roundTrip = config.base_mode_open(keypair.private_key, keyAndCiphertext.encapped_key, info, keyAndCiphertext.ciphertext, aad);
51
- import_chai.assert.equal(startMessage, decoder.decode(roundTrip));
52
- });
53
- }
54
- }
55
- }
56
- });
57
- });
@@ -1 +0,0 @@
1
- *
package/pkg/web/LICENSE DELETED
@@ -1,375 +0,0 @@
1
- Copyright 2022 ISRG, except where otherwise noted. All rights reserved.
2
-
3
- Mozilla Public License Version 2.0
4
- ==================================
5
-
6
- 1. Definitions
7
- --------------
8
-
9
- 1.1. "Contributor"
10
- means each individual or legal entity that creates, contributes to
11
- the creation of, or owns Covered Software.
12
-
13
- 1.2. "Contributor Version"
14
- means the combination of the Contributions of others (if any) used
15
- by a Contributor and that particular Contributor's Contribution.
16
-
17
- 1.3. "Contribution"
18
- means Covered Software of a particular Contributor.
19
-
20
- 1.4. "Covered Software"
21
- means Source Code Form to which the initial Contributor has attached
22
- the notice in Exhibit A, the Executable Form of such Source Code
23
- Form, and Modifications of such Source Code Form, in each case
24
- including portions thereof.
25
-
26
- 1.5. "Incompatible With Secondary Licenses"
27
- means
28
-
29
- (a) that the initial Contributor has attached the notice described
30
- in Exhibit B to the Covered Software; or
31
-
32
- (b) that the Covered Software was made available under the terms of
33
- version 1.1 or earlier of the License, but not also under the
34
- terms of a Secondary License.
35
-
36
- 1.6. "Executable Form"
37
- means any form of the work other than Source Code Form.
38
-
39
- 1.7. "Larger Work"
40
- means a work that combines Covered Software with other material, in
41
- a separate file or files, that is not Covered Software.
42
-
43
- 1.8. "License"
44
- means this document.
45
-
46
- 1.9. "Licensable"
47
- means having the right to grant, to the maximum extent possible,
48
- whether at the time of the initial grant or subsequently, any and
49
- all of the rights conveyed by this License.
50
-
51
- 1.10. "Modifications"
52
- means any of the following:
53
-
54
- (a) any file in Source Code Form that results from an addition to,
55
- deletion from, or modification of the contents of Covered
56
- Software; or
57
-
58
- (b) any new file in Source Code Form that contains any Covered
59
- Software.
60
-
61
- 1.11. "Patent Claims" of a Contributor
62
- means any patent claim(s), including without limitation, method,
63
- process, and apparatus claims, in any patent Licensable by such
64
- Contributor that would be infringed, but for the grant of the
65
- License, by the making, using, selling, offering for sale, having
66
- made, import, or transfer of either its Contributions or its
67
- Contributor Version.
68
-
69
- 1.12. "Secondary License"
70
- means either the GNU General Public License, Version 2.0, the GNU
71
- Lesser General Public License, Version 2.1, the GNU Affero General
72
- Public License, Version 3.0, or any later versions of those
73
- licenses.
74
-
75
- 1.13. "Source Code Form"
76
- means the form of the work preferred for making modifications.
77
-
78
- 1.14. "You" (or "Your")
79
- means an individual or a legal entity exercising rights under this
80
- License. For legal entities, "You" includes any entity that
81
- controls, is controlled by, or is under common control with You. For
82
- purposes of this definition, "control" means (a) the power, direct
83
- or indirect, to cause the direction or management of such entity,
84
- whether by contract or otherwise, or (b) ownership of more than
85
- fifty percent (50%) of the outstanding shares or beneficial
86
- ownership of such entity.
87
-
88
- 2. License Grants and Conditions
89
- --------------------------------
90
-
91
- 2.1. Grants
92
-
93
- Each Contributor hereby grants You a world-wide, royalty-free,
94
- non-exclusive license:
95
-
96
- (a) under intellectual property rights (other than patent or trademark)
97
- Licensable by such Contributor to use, reproduce, make available,
98
- modify, display, perform, distribute, and otherwise exploit its
99
- Contributions, either on an unmodified basis, with Modifications, or
100
- as part of a Larger Work; and
101
-
102
- (b) under Patent Claims of such Contributor to make, use, sell, offer
103
- for sale, have made, import, and otherwise transfer either its
104
- Contributions or its Contributor Version.
105
-
106
- 2.2. Effective Date
107
-
108
- The licenses granted in Section 2.1 with respect to any Contribution
109
- become effective for each Contribution on the date the Contributor first
110
- distributes such Contribution.
111
-
112
- 2.3. Limitations on Grant Scope
113
-
114
- The licenses granted in this Section 2 are the only rights granted under
115
- this License. No additional rights or licenses will be implied from the
116
- distribution or licensing of Covered Software under this License.
117
- Notwithstanding Section 2.1(b) above, no patent license is granted by a
118
- Contributor:
119
-
120
- (a) for any code that a Contributor has removed from Covered Software;
121
- or
122
-
123
- (b) for infringements caused by: (i) Your and any other third party's
124
- modifications of Covered Software, or (ii) the combination of its
125
- Contributions with other software (except as part of its Contributor
126
- Version); or
127
-
128
- (c) under Patent Claims infringed by Covered Software in the absence of
129
- its Contributions.
130
-
131
- This License does not grant any rights in the trademarks, service marks,
132
- or logos of any Contributor (except as may be necessary to comply with
133
- the notice requirements in Section 3.4).
134
-
135
- 2.4. Subsequent Licenses
136
-
137
- No Contributor makes additional grants as a result of Your choice to
138
- distribute the Covered Software under a subsequent version of this
139
- License (see Section 10.2) or under the terms of a Secondary License (if
140
- permitted under the terms of Section 3.3).
141
-
142
- 2.5. Representation
143
-
144
- Each Contributor represents that the Contributor believes its
145
- Contributions are its original creation(s) or it has sufficient rights
146
- to grant the rights to its Contributions conveyed by this License.
147
-
148
- 2.6. Fair Use
149
-
150
- This License is not intended to limit any rights You have under
151
- applicable copyright doctrines of fair use, fair dealing, or other
152
- equivalents.
153
-
154
- 2.7. Conditions
155
-
156
- Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
157
- in Section 2.1.
158
-
159
- 3. Responsibilities
160
- -------------------
161
-
162
- 3.1. Distribution of Source Form
163
-
164
- All distribution of Covered Software in Source Code Form, including any
165
- Modifications that You create or to which You contribute, must be under
166
- the terms of this License. You must inform recipients that the Source
167
- Code Form of the Covered Software is governed by the terms of this
168
- License, and how they can obtain a copy of this License. You may not
169
- attempt to alter or restrict the recipients' rights in the Source Code
170
- Form.
171
-
172
- 3.2. Distribution of Executable Form
173
-
174
- If You distribute Covered Software in Executable Form then:
175
-
176
- (a) such Covered Software must also be made available in Source Code
177
- Form, as described in Section 3.1, and You must inform recipients of
178
- the Executable Form how they can obtain a copy of such Source Code
179
- Form by reasonable means in a timely manner, at a charge no more
180
- than the cost of distribution to the recipient; and
181
-
182
- (b) You may distribute such Executable Form under the terms of this
183
- License, or sublicense it under different terms, provided that the
184
- license for the Executable Form does not attempt to limit or alter
185
- the recipients' rights in the Source Code Form under this License.
186
-
187
- 3.3. Distribution of a Larger Work
188
-
189
- You may create and distribute a Larger Work under terms of Your choice,
190
- provided that You also comply with the requirements of this License for
191
- the Covered Software. If the Larger Work is a combination of Covered
192
- Software with a work governed by one or more Secondary Licenses, and the
193
- Covered Software is not Incompatible With Secondary Licenses, this
194
- License permits You to additionally distribute such Covered Software
195
- under the terms of such Secondary License(s), so that the recipient of
196
- the Larger Work may, at their option, further distribute the Covered
197
- Software under the terms of either this License or such Secondary
198
- License(s).
199
-
200
- 3.4. Notices
201
-
202
- You may not remove or alter the substance of any license notices
203
- (including copyright notices, patent notices, disclaimers of warranty,
204
- or limitations of liability) contained within the Source Code Form of
205
- the Covered Software, except that You may alter any license notices to
206
- the extent required to remedy known factual inaccuracies.
207
-
208
- 3.5. Application of Additional Terms
209
-
210
- You may choose to offer, and to charge a fee for, warranty, support,
211
- indemnity or liability obligations to one or more recipients of Covered
212
- Software. However, You may do so only on Your own behalf, and not on
213
- behalf of any Contributor. You must make it absolutely clear that any
214
- such warranty, support, indemnity, or liability obligation is offered by
215
- You alone, and You hereby agree to indemnify every Contributor for any
216
- liability incurred by such Contributor as a result of warranty, support,
217
- indemnity or liability terms You offer. You may include additional
218
- disclaimers of warranty and limitations of liability specific to any
219
- jurisdiction.
220
-
221
- 4. Inability to Comply Due to Statute or Regulation
222
- ---------------------------------------------------
223
-
224
- If it is impossible for You to comply with any of the terms of this
225
- License with respect to some or all of the Covered Software due to
226
- statute, judicial order, or regulation then You must: (a) comply with
227
- the terms of this License to the maximum extent possible; and (b)
228
- describe the limitations and the code they affect. Such description must
229
- be placed in a text file included with all distributions of the Covered
230
- Software under this License. Except to the extent prohibited by statute
231
- or regulation, such description must be sufficiently detailed for a
232
- recipient of ordinary skill to be able to understand it.
233
-
234
- 5. Termination
235
- --------------
236
-
237
- 5.1. The rights granted under this License will terminate automatically
238
- if You fail to comply with any of its terms. However, if You become
239
- compliant, then the rights granted under this License from a particular
240
- Contributor are reinstated (a) provisionally, unless and until such
241
- Contributor explicitly and finally terminates Your grants, and (b) on an
242
- ongoing basis, if such Contributor fails to notify You of the
243
- non-compliance by some reasonable means prior to 60 days after You have
244
- come back into compliance. Moreover, Your grants from a particular
245
- Contributor are reinstated on an ongoing basis if such Contributor
246
- notifies You of the non-compliance by some reasonable means, this is the
247
- first time You have received notice of non-compliance with this License
248
- from such Contributor, and You become compliant prior to 30 days after
249
- Your receipt of the notice.
250
-
251
- 5.2. If You initiate litigation against any entity by asserting a patent
252
- infringement claim (excluding declaratory judgment actions,
253
- counter-claims, and cross-claims) alleging that a Contributor Version
254
- directly or indirectly infringes any patent, then the rights granted to
255
- You by any and all Contributors for the Covered Software under Section
256
- 2.1 of this License shall terminate.
257
-
258
- 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
259
- end user license agreements (excluding distributors and resellers) which
260
- have been validly granted by You or Your distributors under this License
261
- prior to termination shall survive termination.
262
-
263
- ************************************************************************
264
- * *
265
- * 6. Disclaimer of Warranty *
266
- * ------------------------- *
267
- * *
268
- * Covered Software is provided under this License on an "as is" *
269
- * basis, without warranty of any kind, either expressed, implied, or *
270
- * statutory, including, without limitation, warranties that the *
271
- * Covered Software is free of defects, merchantable, fit for a *
272
- * particular purpose or non-infringing. The entire risk as to the *
273
- * quality and performance of the Covered Software is with You. *
274
- * Should any Covered Software prove defective in any respect, You *
275
- * (not any Contributor) assume the cost of any necessary servicing, *
276
- * repair, or correction. This disclaimer of warranty constitutes an *
277
- * essential part of this License. No use of any Covered Software is *
278
- * authorized under this License except under this disclaimer. *
279
- * *
280
- ************************************************************************
281
-
282
- ************************************************************************
283
- * *
284
- * 7. Limitation of Liability *
285
- * -------------------------- *
286
- * *
287
- * Under no circumstances and under no legal theory, whether tort *
288
- * (including negligence), contract, or otherwise, shall any *
289
- * Contributor, or anyone who distributes Covered Software as *
290
- * permitted above, be liable to You for any direct, indirect, *
291
- * special, incidental, or consequential damages of any character *
292
- * including, without limitation, damages for lost profits, loss of *
293
- * goodwill, work stoppage, computer failure or malfunction, or any *
294
- * and all other commercial damages or losses, even if such party *
295
- * shall have been informed of the possibility of such damages. This *
296
- * limitation of liability shall not apply to liability for death or *
297
- * personal injury resulting from such party's negligence to the *
298
- * extent applicable law prohibits such limitation. Some *
299
- * jurisdictions do not allow the exclusion or limitation of *
300
- * incidental or consequential damages, so this exclusion and *
301
- * limitation may not apply to You. *
302
- * *
303
- ************************************************************************
304
-
305
- 8. Litigation
306
- -------------
307
-
308
- Any litigation relating to this License may be brought only in the
309
- courts of a jurisdiction where the defendant maintains its principal
310
- place of business and such litigation shall be governed by laws of that
311
- jurisdiction, without reference to its conflict-of-law provisions.
312
- Nothing in this Section shall prevent a party's ability to bring
313
- cross-claims or counter-claims.
314
-
315
- 9. Miscellaneous
316
- ----------------
317
-
318
- This License represents the complete agreement concerning the subject
319
- matter hereof. If any provision of this License is held to be
320
- unenforceable, such provision shall be reformed only to the extent
321
- necessary to make it enforceable. Any law or regulation which provides
322
- that the language of a contract shall be construed against the drafter
323
- shall not be used to construe this License against a Contributor.
324
-
325
- 10. Versions of the License
326
- ---------------------------
327
-
328
- 10.1. New Versions
329
-
330
- Mozilla Foundation is the license steward. Except as provided in Section
331
- 10.3, no one other than the license steward has the right to modify or
332
- publish new versions of this License. Each version will be given a
333
- distinguishing version number.
334
-
335
- 10.2. Effect of New Versions
336
-
337
- You may distribute the Covered Software under the terms of the version
338
- of the License under which You originally received the Covered Software,
339
- or under the terms of any subsequent version published by the license
340
- steward.
341
-
342
- 10.3. Modified Versions
343
-
344
- If you create software not governed by this License, and you want to
345
- create a new license for such software, you may create and use a
346
- modified version of this License if you rename the license and remove
347
- any references to the name of the license steward (except to note that
348
- such modified license differs from this License).
349
-
350
- 10.4. Distributing Source Code Form that is Incompatible With Secondary
351
- Licenses
352
-
353
- If You choose to distribute Source Code Form that is Incompatible With
354
- Secondary Licenses under the terms of this version of the License, the
355
- notice described in Exhibit B of this License must be attached.
356
-
357
- Exhibit A - Source Code Form License Notice
358
- -------------------------------------------
359
-
360
- This Source Code Form is subject to the terms of the Mozilla Public
361
- License, v. 2.0. If a copy of the MPL was not distributed with this
362
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
363
-
364
- If it is not possible or desirable to put the notice in a particular
365
- file, then You may include the notice in a location (such as a LICENSE
366
- file in a relevant directory) where a recipient would be likely to look
367
- for such a notice.
368
-
369
- You may add additional accurate notices of copyright ownership.
370
-
371
- Exhibit B - "Incompatible With Secondary Licenses" Notice
372
- ---------------------------------------------------------
373
-
374
- This Source Code Form is "Incompatible With Secondary Licenses", as
375
- defined by the Mozilla Public License, v. 2.0.
package/pkg/web/README.md DELETED
@@ -1,83 +0,0 @@
1
- # Hybrid public key encryption with algorithms dispatched at runtime
2
-
3
- This crate provides a generic-free interface to the [`hpke`][hpke]
4
- crate, a rust implementation of the draft RFC9180 [hybrid public key
5
- encryption](https://www.rfc-editor.org/rfc/rfc9180.html)
6
- scheme. If you know the specific (aead, kdf, kem) triple at compile
7
- time, you should use the [`hpke`][hpke] crate directly.
8
-
9
- Currently, this crate only exposes interfaces for the Base mode (0)
10
- described in the hpke draft, and within base mode, only stateless
11
- single-shot message encryption/decryption, as defined in [RFC9180§6][section-6]
12
-
13
- [hpke]: https://github.com/rozbb/rust-hpke
14
- [section-6]: https://www.rfc-editor.org/rfc/rfc9180.html#section-6
15
-
16
- ## WebAssembly ready
17
-
18
- This crate is also published to npm as [`hpke`][npm] as a
19
- typescript/javascript package, and can also be custom built for
20
- specific wasm use cases (omitting unused algorithms) with
21
- [`wasm-pack`][wasm-pack]. For an example of using the library from
22
- node, see [examples/example.ts][example-ts]
23
-
24
- [npm]: https://www.npmjs.com/package/hpke
25
- [wasm-pack]: https://github.com/rustwasm/wasm-pack
26
- [example-ts]: https://github.com/jbr/hpke-dispatch/blob/main/examples/example.ts
27
-
28
- ## Nightly-only feature to work around a wasm-bindgen bug: `cfg_eval`
29
-
30
- In order to opt out of `algo-all` for a wasm build, you must use
31
- nightly and enable the `cfg_eval` cargo feature. This is due to
32
- [wasm-bindgen#2058][wasm-bindgen-2058]. This is not necessary for use
33
- from rust, even when opting out of `algo-all`.
34
-
35
- [hpke]: https://docs.rs/hpke/latest/hpke/
36
- [wasm-bindgen-2058]: https://github.com/rustwasm/wasm-bindgen/issues/2058
37
-
38
- ## Available cargo features:
39
-
40
- * *`cfg_eval`*: allows this crate to be built on nightly rust for wasm
41
- without `algo-all`. Note that `algo-all` (all
42
- algorithms) will build for wasm on any channel without this feature.
43
- disabled by default. Attempting to build for wasm with a subset.
44
-
45
- * *base-mode-open*: Enables hpke base-mode one-shot open behavior
46
- (receiver functionality). Enabled by default.
47
-
48
- * *base-mode-seal*: Enables hpke base-mode one-shot seal behavior
49
- (sender functionality). Enabled by default.
50
-
51
- * *algo-all*: enables all aead, kdf, and kem algorithms. enabled by
52
- default.
53
-
54
- * *aead-all*: Enables `aead-aes-gcm-128`, `aead-aes-gcm-256`, and
55
- `aead-chacha-20-poly-1305` algorithm features. Enabled by default.
56
-
57
- * *kdf-all*: Enables `kdf-sha256`, `kdf-sha384`, `kdf-sha512`
58
- algorithm features. Enabled by default.
59
-
60
- * *kem-all*: Enables both `kem-dh-p256-hkdf-sha256` and
61
- `kem-x25519-hkdf-sha256` algorithm features. Enabled by default.
62
-
63
- * *serde*: enables derived serde serialization and deserialization for
64
- all public structs and enums. Disabled by default.
65
-
66
- ## Example feature usage:
67
-
68
- To depend on this crate from rust with all algorithms,
69
- `base-mode-open`, and `base-mode-seal`, use default features.
70
-
71
- To depend on this crate from rust with all algorithms and serde
72
- enabled, but without `base-mode-seal`: `default-features = false,
73
- features = ["algo-all", "base-mode-open", "serde"]`
74
-
75
- To build for wasm without `kem-x25519-hkdf-sha256` or
76
- `base-mode-open`: `wasm-pack build --no-default-features --features
77
- aead-all,kdf-all,kem-dh-p256-hkdf-sha256,base-mode-seal,cfg_eval`
78
-
79
- To build for wasm with all algorithms but without base-mode-open:
80
- `wasm-pack build --no-default-features --features
81
- algo-all,base-mode-seal`
82
-
83
-