From f62587e15cf48b5c9918d857c1e9468931027b68 Mon Sep 17 00:00:00 2001 From: dajiaji Date: Thu, 29 Aug 2024 14:54:50 +0000 Subject: [PATCH] deploy: e4ee9013c90d3bd6a0b27998d5d91cb3d1b7bd06 --- .../docs/classes/Chacha20Poly1305.html | 12 +++---- core/docs/classes/Aes128Gcm.html | 12 +++---- core/docs/classes/Aes256Gcm.html | 12 +++---- core/docs/classes/BaseError.html | 4 +-- core/docs/classes/CipherSuite.html | 18 +++++------ core/docs/classes/DecapError.html | 4 +-- core/docs/classes/DeriveKeyPairError.html | 4 +-- core/docs/classes/DeserializeError.html | 4 +-- core/docs/classes/Dhkem.html | 32 +++++++++---------- core/docs/classes/DhkemP256HkdfSha256.html | 22 ++++++------- core/docs/classes/DhkemP384HkdfSha384.html | 22 ++++++------- core/docs/classes/DhkemP521HkdfSha512.html | 22 ++++++------- core/docs/classes/Ec.html | 4 +-- core/docs/classes/EncapError.html | 4 +-- core/docs/classes/ExportError.html | 4 +-- core/docs/classes/ExportOnly.html | 12 +++---- core/docs/classes/HkdfSha256.html | 26 +++++++-------- core/docs/classes/HkdfSha384.html | 26 +++++++-------- core/docs/classes/HkdfSha512.html | 26 +++++++-------- core/docs/classes/HpkeError.html | 4 +-- core/docs/classes/Hybridkem.html | 32 +++++++++---------- core/docs/classes/InvalidParamError.html | 4 +-- .../classes/MessageLimitReachedError.html | 4 +-- core/docs/classes/NotSupportedError.html | 4 +-- core/docs/classes/OpenError.html | 4 +-- core/docs/classes/SealError.html | 4 +-- core/docs/classes/SerializeError.html | 4 +-- core/docs/classes/ValidationError.html | 4 +-- core/docs/classes/XCryptoKey.html | 12 +++---- .../interfaces/AeadEncryptionContext.html | 6 ++-- core/docs/interfaces/AeadInterface.html | 12 +++---- core/docs/interfaces/CipherSuiteParams.html | 8 ++--- .../interfaces/CipherSuiteSealResponse.html | 6 ++-- core/docs/interfaces/DhkemInterface.html | 30 ++++++++--------- core/docs/interfaces/DhkemPrimitives.html | 4 +-- core/docs/interfaces/EncryptionContext.html | 8 ++--- core/docs/interfaces/KdfInterface.html | 22 ++++++------- core/docs/interfaces/KemInterface.html | 30 ++++++++--------- core/docs/interfaces/PreSharedKey.html | 6 ++-- .../interfaces/RecipientContextParams.html | 12 +++---- core/docs/interfaces/SenderContext.html | 10 +++--- core/docs/interfaces/SenderContextParams.html | 12 +++---- core/docs/types/AeadId.html | 2 +- core/docs/types/KdfId.html | 2 +- core/docs/types/KemId.html | 2 +- core/docs/types/RecipientContext.html | 2 +- core/docs/variables/AeadId-1.html | 2 +- core/docs/variables/INPUT_LENGTH_LIMIT.html | 2 +- core/docs/variables/KdfId-1.html | 2 +- core/docs/variables/KemId-1.html | 2 +- .../classes/DhkemSecp256k1HkdfSha256.html | 32 +++++++++---------- .../docs/classes/DhkemX25519HkdfSha256.html | 32 +++++++++---------- dhkem-x25519/docs/classes/HkdfSha256.html | 24 +++++++------- dhkem-x25519/docs/classes/X25519.html | 4 +-- .../docs/classes/DhkemX448HkdfSha512.html | 32 +++++++++---------- dhkem-x448/docs/classes/HkdfSha512.html | 24 +++++++------- dhkem-x448/docs/classes/X448.html | 4 +-- docs/classes/BaseError.html | 4 +-- docs/classes/CipherSuite.html | 24 +++++++------- docs/classes/DecapError.html | 4 +-- docs/classes/DeriveKeyPairError.html | 4 +-- docs/classes/DeserializeError.html | 4 +-- docs/classes/EncapError.html | 4 +-- docs/classes/ExportError.html | 4 +-- docs/classes/HpkeError.html | 4 +-- docs/classes/InvalidParamError.html | 4 +-- docs/classes/MessageLimitReachedError.html | 4 +-- docs/classes/NotSupportedError.html | 4 +-- docs/classes/OpenError.html | 4 +-- docs/classes/SealError.html | 4 +-- docs/classes/SerializeError.html | 4 +-- docs/classes/ValidationError.html | 4 +-- docs/interfaces/AeadEncryptionContext.html | 6 ++-- docs/interfaces/AeadInterface.html | 12 +++---- docs/interfaces/CipherSuiteParams.html | 8 ++--- docs/interfaces/CipherSuiteSealResponse.html | 6 ++-- docs/interfaces/EncryptionContext.html | 8 ++--- docs/interfaces/KdfInterface.html | 22 ++++++------- docs/interfaces/KemInterface.html | 30 ++++++++--------- docs/interfaces/PreSharedKey.html | 6 ++-- docs/interfaces/RecipientContextParams.html | 12 +++---- docs/interfaces/SenderContext.html | 10 +++--- docs/interfaces/SenderContextParams.html | 12 +++---- docs/types/Aead.html | 2 +- docs/types/AeadId.html | 2 +- docs/types/Kdf.html | 2 +- docs/types/KdfId.html | 2 +- docs/types/Kem.html | 2 +- docs/types/KemId.html | 2 +- docs/types/RecipientContext.html | 2 +- docs/variables/Aead-1.html | 2 +- docs/variables/AeadId-1.html | 2 +- docs/variables/Kdf-1.html | 2 +- docs/variables/KdfId-1.html | 2 +- docs/variables/Kem-1.html | 2 +- docs/variables/KemId-1.html | 2 +- .../docs/classes/HybridkemX25519Kyber768.html | 22 ++++++------- 97 files changed, 470 insertions(+), 470 deletions(-) diff --git a/chacha20poly1305/docs/classes/Chacha20Poly1305.html b/chacha20poly1305/docs/classes/Chacha20Poly1305.html index b71a4ec0c..3d23edbae 100644 --- a/chacha20poly1305/docs/classes/Chacha20Poly1305.html +++ b/chacha20poly1305/docs/classes/Chacha20Poly1305.html @@ -7,17 +7,17 @@

This class is implemented using @noble/ciphers.

-

Implements

Constructors

Implements

  • AeadInterface

Constructors

Properties

id: AeadId = AeadId.Chacha20Poly1305

AeadId.Chacha20Poly1305 (0x0003)

-
keySize: number = 32

32

-
nonceSize: number = 12

12

-
tagSize: number = 16

16

-

Methods

  • Creates an AEAD encryption context which has seal/open operation.

    +
keySize: number = 32

32

+
nonceSize: number = 12

12

+
tagSize: number = 16

16

+

Methods

  • Creates an AEAD encryption context which has seal/open operation.

    Parameters

    • key: ArrayBuffer

      A byte string of the raw key.

    Returns AeadEncryptionContext

    An AEAD encryption context.

    -
+
diff --git a/core/docs/classes/Aes128Gcm.html b/core/docs/classes/Aes128Gcm.html index ff78230c5..72dfbd019 100644 --- a/core/docs/classes/Aes128Gcm.html +++ b/core/docs/classes/Aes128Gcm.html @@ -4,17 +4,17 @@
import {
Aes128Gcm,
CipherSuite,
DhkemP256HkdfSha256,
HkdfSha256,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP256HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
});
-

Hierarchy (view full)

Implements

Constructors

Hierarchy (view full)

Implements

Constructors

Properties

id: AeadId = AeadId.Aes128Gcm

AeadId.Aes128Gcm (0x0001)

-
keySize: number = 16

16

-
nonceSize: number = 12

12

-
tagSize: number = 16

16

-

Methods

keySize: number = 16

16

+
nonceSize: number = 12

12

+
tagSize: number = 16

16

+

Methods

+
diff --git a/core/docs/classes/Aes256Gcm.html b/core/docs/classes/Aes256Gcm.html index cdedf609e..402f6dd21 100644 --- a/core/docs/classes/Aes256Gcm.html +++ b/core/docs/classes/Aes256Gcm.html @@ -5,17 +5,17 @@
import {
Aes256Gcm,
CipherSuite,
DhkemP256HkdfSha256,
HkdfSha256,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP256HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Aes256Gcm(),
});
-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

id: AeadId = AeadId.Aes256Gcm

AeadId.Aes256Gcm (0x0002)

-
keySize: number = 32

32

-
nonceSize: number = 12

12

-
tagSize: number = 16

16

-

Methods

keySize: number = 32

32

+
nonceSize: number = 12

12

+
tagSize: number = 16

16

+

Methods

+
diff --git a/core/docs/classes/BaseError.html b/core/docs/classes/BaseError.html index d92b0a75f..222638cee 100644 --- a/core/docs/classes/BaseError.html +++ b/core/docs/classes/BaseError.html @@ -1,7 +1,7 @@ BaseError | @hpke/core

Class BaseError

The base error class of hpke-js.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/CipherSuite.html b/core/docs/classes/CipherSuite.html index 74cd9cf3a..e513735e0 100644 --- a/core/docs/classes/CipherSuite.html +++ b/core/docs/classes/CipherSuite.html @@ -39,7 +39,7 @@
import { Aes128Gcm, HkdfSha256, CipherSuite } from "http://deno.land/x/hpke/core/mod.ts";
import { DhkemX25519HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-x25519/mod.ts";
const suite = new CipherSuite({
kem: new DhkemX25519HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • CipherSuiteNative
    • CipherSuite

Constructors

Properties

Accessors

aead @@ -53,32 +53,32 @@

Properties

_api: SubtleCrypto = undefined

Accessors

Methods

  • Returns Promise<void>

Properties

_api: SubtleCrypto = undefined

Accessors

Methods

  • Returns Promise<void>

  • Decrypts a message from a sender.

    +
  • Decrypts a message from a sender.

    If the error occurred, throws DecapError | DeserializeError | OpenError | ValidationError.

    Parameters

    • params: RecipientContextParams

      A set of parameters for building a recipient encryption context.

    • ct: ArrayBuffer

      An encrypted text as bytes to be decrypted.

    • aad: ArrayBuffer = EMPTY

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

+
diff --git a/core/docs/classes/DecapError.html b/core/docs/classes/DecapError.html index 330e8f375..2d2b011e4 100644 --- a/core/docs/classes/DecapError.html +++ b/core/docs/classes/DecapError.html @@ -1,7 +1,7 @@ DecapError | @hpke/core

Class DecapError

decap() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/DeriveKeyPairError.html b/core/docs/classes/DeriveKeyPairError.html index 6b109aafc..3429833c4 100644 --- a/core/docs/classes/DeriveKeyPairError.html +++ b/core/docs/classes/DeriveKeyPairError.html @@ -1,7 +1,7 @@ DeriveKeyPairError | @hpke/core

Class DeriveKeyPairError

Key pair derivation failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/DeserializeError.html b/core/docs/classes/DeserializeError.html index 9bad9763d..b907d7f64 100644 --- a/core/docs/classes/DeserializeError.html +++ b/core/docs/classes/DeserializeError.html @@ -1,7 +1,7 @@ DeserializeError | @hpke/core

Class DeserializeError

Public or private key deserialization failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/Dhkem.html b/core/docs/classes/Dhkem.html index 9a15415b1..28a65d3a4 100644 --- a/core/docs/classes/Dhkem.html +++ b/core/docs/classes/Dhkem.html @@ -1,5 +1,5 @@ Dhkem | @hpke/core

Class Dhkem

The KEM interface.

-

Implements

Constructors

Implements

Constructors

Properties

Constructors

Properties

encSize: number = 0

The length in bytes of an encapsulated key produced by this KEM (Nenc).

-
id: KemId

The KEM identifier.

-
privateKeySize: number = 0

The length in bytes of an encoded private key for this KEM (Nsk).

-
publicKeySize: number = 0

The length in bytes of an encoded public key for this KEM (Npk).

-
secretSize: number = 0

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

-

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

encSize: number = 0

The length in bytes of an encapsulated key produced by this KEM (Nenc).

+
id: KemId

The KEM identifier.

+
privateKeySize: number = 0

The length in bytes of an encoded private key for this KEM (Nsk).

+
publicKeySize: number = 0

The length in bytes of an encoded public key for this KEM (Npk).

+
secretSize: number = 0

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

+

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -64,14 +64,14 @@
  • isPublic: boolean = true

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

+
diff --git a/core/docs/classes/DhkemP256HkdfSha256.html b/core/docs/classes/DhkemP256HkdfSha256.html index fcaee1eca..865c3c1b7 100644 --- a/core/docs/classes/DhkemP256HkdfSha256.html +++ b/core/docs/classes/DhkemP256HkdfSha256.html @@ -5,7 +5,7 @@
import {
Aes128Gcm,
CipherSuite,
DhkemP256HkdfSha256,
HkdfSha256,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP256HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • DhkemP256HkdfSha256Native
    • DhkemP256HkdfSha256

Constructors

Properties

Constructors

Properties

encSize: number = 65
id: KemId = KemId.DhkemP256HkdfSha256
privateKeySize: number = 32
publicKeySize: number = 65
secretSize: number = 32

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

encSize: number = 65
id: KemId = KemId.DhkemP256HkdfSha256
privateKeySize: number = 32
publicKeySize: number = 65
secretSize: number = 32

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Derives a key pair from the byte string ikm.

    +
  • Derives a key pair from the byte string ikm.

    If the error occurred, throws DeriveKeyPairError.

    Parameters

    • ikm: ArrayBuffer

      An input keying material.

    Returns Promise<CryptoKeyPair>

    A key pair derived.

  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    +
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    +
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

  • Generates an ephemeral, fixed-length symmetric key and +

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Generates a key pair.

    +
  • Generates a key pair.

    If the error occurred, throws NotSupportedError.

    Returns Promise<CryptoKeyPair>

    A key pair generated.

  • Imports a public or private key and converts to a CryptoKey.

    +
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -65,14 +65,14 @@
  • isPublic: boolean = true

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    +
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

  • Serializes a public key as CryptoKey to a byte string of length Npk.

    +
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

+
diff --git a/core/docs/classes/DhkemP384HkdfSha384.html b/core/docs/classes/DhkemP384HkdfSha384.html index 39cd6c2dd..41dda442b 100644 --- a/core/docs/classes/DhkemP384HkdfSha384.html +++ b/core/docs/classes/DhkemP384HkdfSha384.html @@ -5,7 +5,7 @@
import {
Aes128Gcm,
CipherSuite,
DhkemP384HkdfSha384,
HkdfSha384,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP384HkdfSha384(),
kdf: new HkdfSha384(),
aead: new Aes128Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • DhkemP384HkdfSha384Native
    • DhkemP384HkdfSha384

Constructors

Properties

Constructors

Properties

encSize: number = 97
id: KemId = KemId.DhkemP384HkdfSha384
privateKeySize: number = 48
publicKeySize: number = 97
secretSize: number = 48

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

encSize: number = 97
id: KemId = KemId.DhkemP384HkdfSha384
privateKeySize: number = 48
publicKeySize: number = 97
secretSize: number = 48

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Derives a key pair from the byte string ikm.

    +
  • Derives a key pair from the byte string ikm.

    If the error occurred, throws DeriveKeyPairError.

    Parameters

    • ikm: ArrayBuffer

      An input keying material.

    Returns Promise<CryptoKeyPair>

    A key pair derived.

  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    +
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    +
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

  • Generates an ephemeral, fixed-length symmetric key and +

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Generates a key pair.

    +
  • Generates a key pair.

    If the error occurred, throws NotSupportedError.

    Returns Promise<CryptoKeyPair>

    A key pair generated.

  • Imports a public or private key and converts to a CryptoKey.

    +
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -65,14 +65,14 @@
  • isPublic: boolean = true

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    +
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

  • Serializes a public key as CryptoKey to a byte string of length Npk.

    +
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

+
diff --git a/core/docs/classes/DhkemP521HkdfSha512.html b/core/docs/classes/DhkemP521HkdfSha512.html index 58b07906e..928823155 100644 --- a/core/docs/classes/DhkemP521HkdfSha512.html +++ b/core/docs/classes/DhkemP521HkdfSha512.html @@ -5,7 +5,7 @@
import {
Aes256Gcm,
CipherSuite,
DhkemP521HkdfSha512,
HkdfSha512,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP521HkdfSha512(),
kdf: new HkdfSha512(),
aead: new Aes256Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • DhkemP521HkdfSha512Native
    • DhkemP521HkdfSha512

Constructors

Properties

Constructors

Properties

encSize: number = 133
id: KemId = KemId.DhkemP521HkdfSha512
privateKeySize: number = 64
publicKeySize: number = 133
secretSize: number = 64

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

encSize: number = 133
id: KemId = KemId.DhkemP521HkdfSha512
privateKeySize: number = 64
publicKeySize: number = 133
secretSize: number = 64

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Derives a key pair from the byte string ikm.

    +
  • Derives a key pair from the byte string ikm.

    If the error occurred, throws DeriveKeyPairError.

    Parameters

    • ikm: ArrayBuffer

      An input keying material.

    Returns Promise<CryptoKeyPair>

    A key pair derived.

  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    +
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    +
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

  • Generates an ephemeral, fixed-length symmetric key and +

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Generates a key pair.

    +
  • Generates a key pair.

    If the error occurred, throws NotSupportedError.

    Returns Promise<CryptoKeyPair>

    A key pair generated.

  • Imports a public or private key and converts to a CryptoKey.

    +
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -65,14 +65,14 @@
  • isPublic: boolean = true

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    +
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

  • Serializes a public key as CryptoKey to a byte string of length Npk.

    +
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

+
diff --git a/core/docs/classes/Ec.html b/core/docs/classes/Ec.html index bf410963b..3dc97aa70 100644 --- a/core/docs/classes/Ec.html +++ b/core/docs/classes/Ec.html @@ -1,4 +1,4 @@ -Ec | @hpke/core

Hierarchy

  • NativeAlgorithm
    • Ec

Implements

Constructors

constructor +Ec | @hpke/core

Hierarchy

  • NativeAlgorithm
    • Ec

Implements

Constructors

Properties

Methods

Constructors

Properties

_api: SubtleCrypto = undefined

Methods

  • Returns Promise<void>

+

Constructors

Properties

_api: SubtleCrypto = undefined

Methods

  • Returns Promise<void>

diff --git a/core/docs/classes/EncapError.html b/core/docs/classes/EncapError.html index 89ff4606a..e698a4616 100644 --- a/core/docs/classes/EncapError.html +++ b/core/docs/classes/EncapError.html @@ -1,7 +1,7 @@ EncapError | @hpke/core

Class EncapError

encap() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/ExportError.html b/core/docs/classes/ExportError.html index 644423687..f852dd2b8 100644 --- a/core/docs/classes/ExportError.html +++ b/core/docs/classes/ExportError.html @@ -1,7 +1,7 @@ ExportError | @hpke/core

Class ExportError

Secret export failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/ExportOnly.html b/core/docs/classes/ExportOnly.html index 298982239..e9c3402aa 100644 --- a/core/docs/classes/ExportOnly.html +++ b/core/docs/classes/ExportOnly.html @@ -5,16 +5,16 @@
import {
CipherSuite,
DhkemP256HkdfSha256,
ExportOnly,
HkdfSha256,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP256HkdfSha256(),
kdf: new HkdfSha256(),
aead: new ExportOnly(),
});
-

Implements

Constructors

Implements

Constructors

Properties

id: AeadId = AeadId.ExportOnly

The KDF identifier.

-
keySize: number = 0

The length in bytes of an AEAD key (Nk).

-
nonceSize: number = 0

The length in bytes of an AEAD nonce (Nn).

-
tagSize: number = 0

The length in bytes of an AEAD authentication tag (Nt).

-

Methods

keySize: number = 0

The length in bytes of an AEAD key (Nk).

+
nonceSize: number = 0

The length in bytes of an AEAD nonce (Nn).

+
tagSize: number = 0

The length in bytes of an AEAD authentication tag (Nt).

+

Methods

+
diff --git a/core/docs/classes/HkdfSha256.html b/core/docs/classes/HkdfSha256.html index f2034c0fa..e04e7ef46 100644 --- a/core/docs/classes/HkdfSha256.html +++ b/core/docs/classes/HkdfSha256.html @@ -7,7 +7,7 @@
import {
Aes128Gcm,
CipherSuite,
DhkemP256HkdfSha256,
HkdfSha256,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP256HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • HkdfSha256Native
    • HkdfSha256

Constructors

Properties

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

-
hashSize: number = 32

32

-
id: KdfId = KdfId.HkdfSha256

KdfId.HkdfSha256 (0x0001)

-

Methods

  • Returns void

  • Returns Promise<void>

  • Builds a labeled input keying material.

    +

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

+
hashSize: number = 32

32

+
id: KdfId = KdfId.HkdfSha256

KdfId.HkdfSha256 (0x0001)

+

Methods

  • Returns void

  • Returns Promise<void>

  • Builds a labeled input keying material.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

    Returns Uint8Array

    An input keying material as bytes.

    -
  • Builds a labeled info string.

    +
  • Builds a labeled info string.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length of the output byte string.

    Returns Uint8Array

    An info string as bytes.

    -
  • Expands a pseudorandom key prk.

    +
  • Expands a pseudorandom key prk.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    +
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    +
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Initializes the instance by setting a suite_id defined in RFC9180.

    +
  • Initializes the instance by setting a suite_id defined in RFC9180.

    Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -

    Returns void

  • Extracts a pseudorandom key with label.

    +

Returns void

  • Extracts a pseudorandom key with label.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key with label.

    +
  • Extracts a pseudorandom key with label.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
+
diff --git a/core/docs/classes/HkdfSha384.html b/core/docs/classes/HkdfSha384.html index 21f88e786..bb05e6511 100644 --- a/core/docs/classes/HkdfSha384.html +++ b/core/docs/classes/HkdfSha384.html @@ -7,7 +7,7 @@
import {
Aes128Gcm,
CipherSuite,
DhkemP384HkdfSha384,
HkdfSha384,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP384HkdfSha384(),
kdf: new HkdfSha384(),
aead: new Aes128Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • HkdfSha384Native
    • HkdfSha384

Constructors

Properties

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

-
hashSize: number = 48

48

-
id: KdfId = KdfId.HkdfSha384

KdfId.HkdfSha384 (0x0002)

-

Methods

  • Returns void

  • Returns Promise<void>

  • Builds a labeled input keying material.

    +

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

+
hashSize: number = 48

48

+
id: KdfId = KdfId.HkdfSha384

KdfId.HkdfSha384 (0x0002)

+

Methods

  • Returns void

  • Returns Promise<void>

  • Builds a labeled input keying material.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

    Returns Uint8Array

    An input keying material as bytes.

    -
  • Builds a labeled info string.

    +
  • Builds a labeled info string.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length of the output byte string.

    Returns Uint8Array

    An info string as bytes.

    -
  • Expands a pseudorandom key prk.

    +
  • Expands a pseudorandom key prk.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    +
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    +
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Initializes the instance by setting a suite_id defined in RFC9180.

    +
  • Initializes the instance by setting a suite_id defined in RFC9180.

    Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -

    Returns void

  • Extracts a pseudorandom key with label.

    +

Returns void

  • Extracts a pseudorandom key with label.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key with label.

    +
  • Extracts a pseudorandom key with label.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
+
diff --git a/core/docs/classes/HkdfSha512.html b/core/docs/classes/HkdfSha512.html index d2c1b2246..cdfc93931 100644 --- a/core/docs/classes/HkdfSha512.html +++ b/core/docs/classes/HkdfSha512.html @@ -7,7 +7,7 @@
import {
Aes256Gcm,
CipherSuite,
DhkemP521HkdfSha512,
HkdfSha512,
} from "http://deno.land/x/hpke/core/mod.ts";

const suite = new CipherSuite({
kem: new DhkemP521HkdfSha512(),
kdf: new HkdfSha512(),
aead: new Aes256Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • HkdfSha512Native
    • HkdfSha512

Constructors

Properties

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

-
hashSize: number = 64

64

-
id: KdfId = KdfId.HkdfSha512

KdfId.HkdfSha512 (0x0003)

-

Methods

  • Returns void

  • Returns Promise<void>

  • Builds a labeled input keying material.

    +

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

+
hashSize: number = 64

64

+
id: KdfId = KdfId.HkdfSha512

KdfId.HkdfSha512 (0x0003)

+

Methods

  • Returns void

  • Returns Promise<void>

  • Builds a labeled input keying material.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

    Returns Uint8Array

    An input keying material as bytes.

    -
  • Builds a labeled info string.

    +
  • Builds a labeled info string.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length of the output byte string.

    Returns Uint8Array

    An info string as bytes.

    -
  • Expands a pseudorandom key prk.

    +
  • Expands a pseudorandom key prk.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    +
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    +
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Initializes the instance by setting a suite_id defined in RFC9180.

    +
  • Initializes the instance by setting a suite_id defined in RFC9180.

    Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -

    Returns void

  • Extracts a pseudorandom key with label.

    +

Returns void

  • Extracts a pseudorandom key with label.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key with label.

    +
  • Extracts a pseudorandom key with label.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
+
diff --git a/core/docs/classes/HpkeError.html b/core/docs/classes/HpkeError.html index a74d1997c..f0b70440a 100644 --- a/core/docs/classes/HpkeError.html +++ b/core/docs/classes/HpkeError.html @@ -1,7 +1,7 @@ HpkeError | @hpke/core

Class HpkeError

The base error class of hpke-js.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/Hybridkem.html b/core/docs/classes/Hybridkem.html index 963ffa8b4..5bfc2357f 100644 --- a/core/docs/classes/Hybridkem.html +++ b/core/docs/classes/Hybridkem.html @@ -1,5 +1,5 @@ Hybridkem | @hpke/core

Class Hybridkem

The KEM interface.

-

Implements

Constructors

Implements

Constructors

Properties

Constructors

Properties

encSize: number = 0

The length in bytes of an encapsulated key produced by this KEM (Nenc).

-
id: KemId = KemId.NotAssigned

The KEM identifier.

-
name: string = ""
privateKeySize: number = 0

The length in bytes of an encoded private key for this KEM (Nsk).

-
publicKeySize: number = 0

The length in bytes of an encoded public key for this KEM (Npk).

-
secretSize: number = 0

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

-

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

encSize: number = 0

The length in bytes of an encapsulated key produced by this KEM (Nenc).

+
id: KemId = KemId.NotAssigned

The KEM identifier.

+
name: string = ""
privateKeySize: number = 0

The length in bytes of an encoded private key for this KEM (Nsk).

+
publicKeySize: number = 0

The length in bytes of an encoded public key for this KEM (Npk).

+
secretSize: number = 0

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

+

Methods

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -66,14 +66,14 @@
  • isPublic: boolean = true

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

+
diff --git a/core/docs/classes/InvalidParamError.html b/core/docs/classes/InvalidParamError.html index f0678d6a4..93deb8105 100644 --- a/core/docs/classes/InvalidParamError.html +++ b/core/docs/classes/InvalidParamError.html @@ -1,7 +1,7 @@ InvalidParamError | @hpke/core

Class InvalidParamError

Invalid parameter.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/MessageLimitReachedError.html b/core/docs/classes/MessageLimitReachedError.html index d48d3e697..e0d816817 100644 --- a/core/docs/classes/MessageLimitReachedError.html +++ b/core/docs/classes/MessageLimitReachedError.html @@ -1,7 +1,7 @@ MessageLimitReachedError | @hpke/core

Class MessageLimitReachedError

Sequence number overflow on the encryption context.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/NotSupportedError.html b/core/docs/classes/NotSupportedError.html index 5fb8a8f1d..129685050 100644 --- a/core/docs/classes/NotSupportedError.html +++ b/core/docs/classes/NotSupportedError.html @@ -1,7 +1,7 @@ NotSupportedError | @hpke/core

Class NotSupportedError

Not supported failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/OpenError.html b/core/docs/classes/OpenError.html index 9b1ea24e1..b0267f59c 100644 --- a/core/docs/classes/OpenError.html +++ b/core/docs/classes/OpenError.html @@ -1,7 +1,7 @@ OpenError | @hpke/core

Class OpenError

open() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/SealError.html b/core/docs/classes/SealError.html index 4b19115c7..65cb65655 100644 --- a/core/docs/classes/SealError.html +++ b/core/docs/classes/SealError.html @@ -1,7 +1,7 @@ SealError | @hpke/core

Class SealError

seal() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/SerializeError.html b/core/docs/classes/SerializeError.html index 77c48f294..f8f25227d 100644 --- a/core/docs/classes/SerializeError.html +++ b/core/docs/classes/SerializeError.html @@ -1,7 +1,7 @@ SerializeError | @hpke/core

Class SerializeError

Public or private key serialization failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/ValidationError.html b/core/docs/classes/ValidationError.html index 47c58c484..2c3315d32 100644 --- a/core/docs/classes/ValidationError.html +++ b/core/docs/classes/ValidationError.html @@ -1,7 +1,7 @@ ValidationError | @hpke/core

Class ValidationError

KEM input or output validation failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/core/docs/classes/XCryptoKey.html b/core/docs/classes/XCryptoKey.html index 61bc61303..64af2e3ef 100644 --- a/core/docs/classes/XCryptoKey.html +++ b/core/docs/classes/XCryptoKey.html @@ -1,11 +1,11 @@ -XCryptoKey | @hpke/core

Class XCryptoKey

Implements

  • CryptoKey

Constructors

constructor +XCryptoKey | @hpke/core

Class XCryptoKey

Implements

  • CryptoKey

Constructors

Properties

algorithm: KeyAlgorithm
extractable: boolean = true
key: Uint8Array
type: "private" | "public"
usages: KeyUsage[]
+

Constructors

Properties

algorithm: KeyAlgorithm
extractable: boolean = true
key: Uint8Array
type: "private" | "public"
usages: KeyUsage[]
diff --git a/core/docs/interfaces/AeadEncryptionContext.html b/core/docs/interfaces/AeadEncryptionContext.html index 9d6c3837c..f7b1d5523 100644 --- a/core/docs/interfaces/AeadEncryptionContext.html +++ b/core/docs/interfaces/AeadEncryptionContext.html @@ -1,14 +1,14 @@ AeadEncryptionContext | @hpke/core

Interface AeadEncryptionContext

The AEAD encryption context interface.

-
interface AeadEncryptionContext {
    open(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
    seal(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
}

Methods

interface AeadEncryptionContext {
    open(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
    seal(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
}

Methods

Methods

  • Decrypts data with an initialization vector and additional authenticated data.

    Parameters

    • iv: ArrayBuffer

      An initialization vector.

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

    • aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    -
  • Encrypts data with an initialization vector and additional authenticated data.

    Parameters

    • iv: ArrayBuffer

      An initialization vector.

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

    • aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    -
+
diff --git a/core/docs/interfaces/AeadInterface.html b/core/docs/interfaces/AeadInterface.html index 4a0c955d2..5badf7687 100644 --- a/core/docs/interfaces/AeadInterface.html +++ b/core/docs/interfaces/AeadInterface.html @@ -1,14 +1,14 @@ AeadInterface | @hpke/core

Interface AeadInterface

The AEAD interface.

-
interface AeadInterface {
    id: AeadId;
    keySize: number;
    nonceSize: number;
    tagSize: number;
    createEncryptionContext(key: ArrayBuffer): AeadEncryptionContext;
}

Implemented by

Properties

id +
interface AeadInterface {
    id: AeadId;
    keySize: number;
    nonceSize: number;
    tagSize: number;
    createEncryptionContext(key: ArrayBuffer): AeadEncryptionContext;
}

Implemented by

Properties

id: AeadId

The KDF identifier.

-
keySize: number

The length in bytes of an AEAD key (Nk).

-
nonceSize: number

The length in bytes of an AEAD nonce (Nn).

-
tagSize: number

The length in bytes of an AEAD authentication tag (Nt).

-

Methods

keySize: number

The length in bytes of an AEAD key (Nk).

+
nonceSize: number

The length in bytes of an AEAD nonce (Nn).

+
tagSize: number

The length in bytes of an AEAD authentication tag (Nt).

+

Methods

+
diff --git a/core/docs/interfaces/CipherSuiteParams.html b/core/docs/interfaces/CipherSuiteParams.html index b0193465f..13a82ddfd 100644 --- a/core/docs/interfaces/CipherSuiteParams.html +++ b/core/docs/interfaces/CipherSuiteParams.html @@ -1,8 +1,8 @@ CipherSuiteParams | @hpke/core

Interface CipherSuiteParams

The parameters used to configure the CipherSuite.

-
interface CipherSuiteParams {
    aead: AeadId | AeadInterface;
    kdf: KdfId | KdfInterface;
    kem: KemId | KemInterface;
}

Properties

interface CipherSuiteParams {
    aead: AeadId | AeadInterface;
    kdf: KdfId | KdfInterface;
    kem: KemId | KemInterface;
}

Properties

Properties

The AEAD (Authenticated Encryption with Addtional Data) identifier or the AEAD object.

-

The KDF (Key Derivation Function) identifier or the KDF object.

-

The KEM (Key Encapsulation Mechanism) identifier or the KEM object.

-
+

The KDF (Key Derivation Function) identifier or the KDF object.

+

The KEM (Key Encapsulation Mechanism) identifier or the KEM object.

+
diff --git a/core/docs/interfaces/CipherSuiteSealResponse.html b/core/docs/interfaces/CipherSuiteSealResponse.html index dca9cb7a6..78e0e8991 100644 --- a/core/docs/interfaces/CipherSuiteSealResponse.html +++ b/core/docs/interfaces/CipherSuiteSealResponse.html @@ -1,6 +1,6 @@ CipherSuiteSealResponse | @hpke/core

Interface CipherSuiteSealResponse

The response of the single-shot seal API.

-
interface CipherSuiteSealResponse {
    ct: ArrayBuffer;
    enc: ArrayBuffer;
}

Properties

ct +
interface CipherSuiteSealResponse {
    ct: ArrayBuffer;
    enc: ArrayBuffer;
}

Properties

Properties

ct: ArrayBuffer

The ciphertext as bytes.

-
enc: ArrayBuffer

The encapsulated key.

-
+
enc: ArrayBuffer

The encapsulated key.

+
diff --git a/core/docs/interfaces/DhkemInterface.html b/core/docs/interfaces/DhkemInterface.html index 963d7f6cc..a00e303fc 100644 --- a/core/docs/interfaces/DhkemInterface.html +++ b/core/docs/interfaces/DhkemInterface.html @@ -1,5 +1,5 @@ DhkemInterface | @hpke/core

Interface DhkemInterface

The DHKEM interface.

-
interface DhkemInterface {
    encSize: number;
    id: KemId;
    kdf: KdfInterface;
    privateKeySize: number;
    publicKeySize: number;
    secretSize: number;
    decap(params: RecipientContextParams): Promise<ArrayBuffer>;
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    encap(params: SenderContextParams): Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic?: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Properties

interface DhkemInterface {
    encSize: number;
    id: KemId;
    kdf: KdfInterface;
    privateKeySize: number;
    publicKeySize: number;
    secretSize: number;
    decap(params: RecipientContextParams): Promise<ArrayBuffer>;
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    encap(params: SenderContextParams): Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic?: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Properties

encSize: number

The length in bytes of an encapsulated key produced by this KEM (Nenc).

-
id: KemId

The KEM identifier.

-
privateKeySize: number

The length in bytes of an encoded private key for this KEM (Nsk).

-
publicKeySize: number

The length in bytes of an encoded public key for this KEM (Npk).

-
secretSize: number

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

-

Methods

id: KemId

The KEM identifier.

+
privateKeySize: number

The length in bytes of an encoded private key for this KEM (Nsk).

+
publicKeySize: number

The length in bytes of an encoded public key for this KEM (Npk).

+
secretSize: number

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

+

Methods

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -62,14 +62,14 @@
  • OptionalisPublic: boolean

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

+
diff --git a/core/docs/interfaces/DhkemPrimitives.html b/core/docs/interfaces/DhkemPrimitives.html index 30b315e5f..214274947 100644 --- a/core/docs/interfaces/DhkemPrimitives.html +++ b/core/docs/interfaces/DhkemPrimitives.html @@ -1,4 +1,4 @@ -DhkemPrimitives | @hpke/core

Interface DhkemPrimitives

interface DhkemPrimitives {
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    derivePublicKey(key: CryptoKey): Promise<CryptoKey>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    dh(sk: CryptoKey, pk: CryptoKey): Promise<ArrayBuffer>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Implemented by

Methods

deriveKeyPair +DhkemPrimitives | @hpke/core

Interface DhkemPrimitives

interface DhkemPrimitives {
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    derivePublicKey(key: CryptoKey): Promise<CryptoKey>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    dh(sk: CryptoKey, pk: CryptoKey): Promise<ArrayBuffer>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Implemented by

Methods

  • Parameters

    • format: "raw" | "jwk"
    • key: ArrayBuffer | JsonWebKey
    • isPublic: boolean

    Returns Promise<CryptoKey>

+

Methods

  • Parameters

    • format: "raw" | "jwk"
    • key: ArrayBuffer | JsonWebKey
    • isPublic: boolean

    Returns Promise<CryptoKey>

diff --git a/core/docs/interfaces/EncryptionContext.html b/core/docs/interfaces/EncryptionContext.html index 282053bb4..c8fa219ee 100644 --- a/core/docs/interfaces/EncryptionContext.html +++ b/core/docs/interfaces/EncryptionContext.html @@ -1,5 +1,5 @@ EncryptionContext | @hpke/core

Interface EncryptionContext

The encryption context interface for a recipient and a sender.

-
interface EncryptionContext {
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Methods

interface EncryptionContext {
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Methods

Methods

  • Exports a secret using a variable-length pseudorandom function.

    @@ -8,16 +8,16 @@
  • len: number

    A desired length in bytes of the output secret.

Returns Promise<ArrayBuffer>

A secret string as bytes.

ExportError

-
  • Decrypts data.

    If the error occurred, throws OpenError.

    Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

    • Optionalaad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    OpenError

    -
  • Encrypts data.

    If the error occurred, throws SealError | MessageLimitReachedError.

    Parameters

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

    • Optionalaad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

+
diff --git a/core/docs/interfaces/KdfInterface.html b/core/docs/interfaces/KdfInterface.html index 8a75a54b7..e38758071 100644 --- a/core/docs/interfaces/KdfInterface.html +++ b/core/docs/interfaces/KdfInterface.html @@ -1,5 +1,5 @@ KdfInterface | @hpke/core

Interface KdfInterface

The KDF interface.

-
interface KdfInterface {
    hashSize: number;
    id: KdfId;
    buildLabeledIkm(label: Uint8Array, ikm: Uint8Array): Uint8Array;
    buildLabeledInfo(label: Uint8Array, info: Uint8Array, len: number): Uint8Array;
    expand(prk: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    extract(salt: ArrayBuffer, ikm: ArrayBuffer): Promise<ArrayBuffer>;
    extractAndExpand(salt: ArrayBuffer, ikm: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    init(suiteId: Uint8Array): void;
    labeledExpand(prk: ArrayBuffer, label: Uint8Array, info: Uint8Array, len: number): Promise<ArrayBuffer>;
    labeledExtract(salt: ArrayBuffer, label: Uint8Array, ikm: Uint8Array): Promise<ArrayBuffer>;
}

Properties

interface KdfInterface {
    hashSize: number;
    id: KdfId;
    buildLabeledIkm(label: Uint8Array, ikm: Uint8Array): Uint8Array;
    buildLabeledInfo(label: Uint8Array, info: Uint8Array, len: number): Uint8Array;
    expand(prk: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    extract(salt: ArrayBuffer, ikm: ArrayBuffer): Promise<ArrayBuffer>;
    extractAndExpand(salt: ArrayBuffer, ikm: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    init(suiteId: Uint8Array): void;
    labeledExpand(prk: ArrayBuffer, label: Uint8Array, info: Uint8Array, len: number): Promise<ArrayBuffer>;
    labeledExtract(salt: ArrayBuffer, label: Uint8Array, ikm: Uint8Array): Promise<ArrayBuffer>;
}

Properties

hashSize: number

The output size of the extract() function in bytes (Nh).

-
id: KdfId

The KDF identifier.

-

Methods

id: KdfId

The KDF identifier.

+

Methods

  • Builds a labeled input keying material.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

    Returns Uint8Array

    An input keying material as bytes.

    -
  • Builds a labeled info string.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length of the output byte string.

    Returns Uint8Array

    An info string as bytes.

    -
  • Expands a pseudorandom key prk.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    +
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Initializes the instance by setting a suite_id defined in RFC9180.

    Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -

    Returns void

  • Extracts a pseudorandom key with label.

    +

Returns void

  • Extracts a pseudorandom key with label.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key with label.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
+
diff --git a/core/docs/interfaces/KemInterface.html b/core/docs/interfaces/KemInterface.html index 4ea6b928b..f595eede5 100644 --- a/core/docs/interfaces/KemInterface.html +++ b/core/docs/interfaces/KemInterface.html @@ -1,5 +1,5 @@ KemInterface | @hpke/core

Interface KemInterface

The KEM interface.

-
interface KemInterface {
    encSize: number;
    id: KemId;
    privateKeySize: number;
    publicKeySize: number;
    secretSize: number;
    decap(params: RecipientContextParams): Promise<ArrayBuffer>;
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    encap(params: SenderContextParams): Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic?: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Implemented by

Properties

interface KemInterface {
    encSize: number;
    id: KemId;
    privateKeySize: number;
    publicKeySize: number;
    secretSize: number;
    decap(params: RecipientContextParams): Promise<ArrayBuffer>;
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    encap(params: SenderContextParams): Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic?: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Implemented by

Properties

encSize: number

The length in bytes of an encapsulated key produced by this KEM (Nenc).

-
id: KemId

The KEM identifier.

-
privateKeySize: number

The length in bytes of an encoded private key for this KEM (Nsk).

-
publicKeySize: number

The length in bytes of an encoded public key for this KEM (Npk).

-
secretSize: number

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

-

Methods

id: KemId

The KEM identifier.

+
privateKeySize: number

The length in bytes of an encoded private key for this KEM (Nsk).

+
publicKeySize: number

The length in bytes of an encoded public key for this KEM (Npk).

+
secretSize: number

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

+

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Generates an ephemeral, fixed-length symmetric key and +

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -61,14 +61,14 @@
  • OptionalisPublic: boolean

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

  • Serializes a public key as CryptoKey to a byte string of length Npk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

+
diff --git a/core/docs/interfaces/PreSharedKey.html b/core/docs/interfaces/PreSharedKey.html index 70cf4d617..19b2d94d1 100644 --- a/core/docs/interfaces/PreSharedKey.html +++ b/core/docs/interfaces/PreSharedKey.html @@ -1,6 +1,6 @@ PreSharedKey | @hpke/core

Interface PreSharedKey

The pre-shared key interface.

-
interface PreSharedKey {
    id: ArrayBuffer;
    key: ArrayBuffer;
}

Properties

id +
interface PreSharedKey {
    id: ArrayBuffer;
    key: ArrayBuffer;
}

Properties

Properties

id: ArrayBuffer

The key identifier.

-
key: ArrayBuffer

The body of the pre-shared key.

-
+
key: ArrayBuffer

The body of the pre-shared key.

+
diff --git a/core/docs/interfaces/RecipientContextParams.html b/core/docs/interfaces/RecipientContextParams.html index 5055025cd..c8a761fb2 100644 --- a/core/docs/interfaces/RecipientContextParams.html +++ b/core/docs/interfaces/RecipientContextParams.html @@ -1,13 +1,13 @@ RecipientContextParams | @hpke/core

Interface RecipientContextParams

The parameters used to setup the RecipientContext.

-
interface RecipientContextParams {
    enc: ArrayBuffer;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientKey: CryptoKeyPair | CryptoKey;
    senderPublicKey?: CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • RecipientContextParams

Properties

enc +
interface RecipientContextParams {
    enc: ArrayBuffer;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientKey: CryptoKeyPair | CryptoKey;
    senderPublicKey?: CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • RecipientContextParams

Properties

enc: ArrayBuffer

A byte string of the encapsulated key received from a sender.

-
info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

-

A pre-shared key (PSK) held by both the sender and recipient. +

info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

+

A pre-shared key (PSK) held by both the sender and recipient. The PSK should have at least 32 bytes :and the maxmum length of the PSK is 128 bytes.

-
recipientKey: CryptoKeyPair | CryptoKey

A recipient private key or a key pair.

-
senderPublicKey?: CryptoKey

A sender public key for Auth mode.

-
+
recipientKey: CryptoKeyPair | CryptoKey

A recipient private key or a key pair.

+
senderPublicKey?: CryptoKey

A sender public key for Auth mode.

+
diff --git a/core/docs/interfaces/SenderContext.html b/core/docs/interfaces/SenderContext.html index 21d9ea02d..e9f902ff0 100644 --- a/core/docs/interfaces/SenderContext.html +++ b/core/docs/interfaces/SenderContext.html @@ -1,25 +1,25 @@ SenderContext | @hpke/core

Interface SenderContext

The sender encryption context.

-
interface SenderContext {
    enc: ArrayBuffer;
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Properties

enc +
interface SenderContext {
    enc: ArrayBuffer;
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Properties

Methods

Properties

enc: ArrayBuffer

The encapsulated key generated by the sender.

-

Methods

Methods

  • Exports a secret using a variable-length pseudorandom function.

    If the error occurred, throws ExportError.

    Parameters

    • exporterContext: ArrayBuffer

      An exporter context string as bytes. The maximum length is 128 bytes.

    • len: number

      A desired length in bytes of the output secret.

    Returns Promise<ArrayBuffer>

    A secret string as bytes.

    ExportError

    -
  • Decrypts data.

    If the error occurred, throws OpenError.

    Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

    • Optionalaad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    OpenError

    -
+
diff --git a/core/docs/interfaces/SenderContextParams.html b/core/docs/interfaces/SenderContextParams.html index 0a2e527d1..e6c7f7584 100644 --- a/core/docs/interfaces/SenderContextParams.html +++ b/core/docs/interfaces/SenderContextParams.html @@ -1,13 +1,13 @@ SenderContextParams | @hpke/core

Interface SenderContextParams

The parameters used to setup the SenderContext.

-
interface SenderContextParams {
    ekm?: ArrayBuffer | CryptoKeyPair;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientPublicKey: CryptoKey;
    senderKey?: CryptoKeyPair | CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • SenderContextParams

Properties

interface SenderContextParams {
    ekm?: ArrayBuffer | CryptoKeyPair;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientPublicKey: CryptoKey;
    senderKey?: CryptoKeyPair | CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • SenderContextParams

Properties

ekm?: ArrayBuffer | CryptoKeyPair

DO NOT USE. FOR DEBUGGING/TESTING PURPOSES ONLY.

-
info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

-

A pre-shared key (PSK) held by both the sender and recipient. +

info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

+

A pre-shared key (PSK) held by both the sender and recipient. The PSK should have at least 32 bytes :and the maxmum length of the PSK is 128 bytes.

-
recipientPublicKey: CryptoKey

A recipient public key.

-
senderKey?: CryptoKeyPair | CryptoKey

A sender private key or a key pair for Auth mode.

-
+
recipientPublicKey: CryptoKey

A recipient public key.

+
senderKey?: CryptoKeyPair | CryptoKey

A sender private key or a key pair for Auth mode.

+
diff --git a/core/docs/types/AeadId.html b/core/docs/types/AeadId.html index 99ce633b3..6df946484 100644 --- a/core/docs/types/AeadId.html +++ b/core/docs/types/AeadId.html @@ -1,2 +1,2 @@ AeadId | @hpke/core

Type Alias AeadId

AeadId: typeof AeadId[keyof typeof AeadId]

The type alias of the supported AEAD identifiers.

-
+
diff --git a/core/docs/types/KdfId.html b/core/docs/types/KdfId.html index 689597674..22614b7f0 100644 --- a/core/docs/types/KdfId.html +++ b/core/docs/types/KdfId.html @@ -1,2 +1,2 @@ KdfId | @hpke/core

Type Alias KdfId

KdfId: typeof KdfId[keyof typeof KdfId]

The type alias of the supported KDF identifiers.

-
+
diff --git a/core/docs/types/KemId.html b/core/docs/types/KemId.html index a43d18fc2..c9ab466df 100644 --- a/core/docs/types/KemId.html +++ b/core/docs/types/KemId.html @@ -1,2 +1,2 @@ KemId | @hpke/core

Type Alias KemId

KemId: typeof KemId[keyof typeof KemId]

The type alias of the supported KEM identifiers.

-
+
diff --git a/core/docs/types/RecipientContext.html b/core/docs/types/RecipientContext.html index c6c637fec..9f476d3cf 100644 --- a/core/docs/types/RecipientContext.html +++ b/core/docs/types/RecipientContext.html @@ -1,2 +1,2 @@ RecipientContext | @hpke/core

Type Alias RecipientContext

RecipientContext: EncryptionContext

The recipient encryption context.

-
+
diff --git a/core/docs/variables/AeadId-1.html b/core/docs/variables/AeadId-1.html index a1aff94ac..d395a67c7 100644 --- a/core/docs/variables/AeadId-1.html +++ b/core/docs/variables/AeadId-1.html @@ -1,2 +1,2 @@ AeadId | @hpke/core

Variable AeadIdConst

AeadId: {
    Aes128Gcm: 1;
    Aes256Gcm: 2;
    Chacha20Poly1305: 3;
    ExportOnly: 65535;
} = Aead

The supported Authenticated Encryption with Associated Data (AEAD) identifiers.

-
+
diff --git a/core/docs/variables/INPUT_LENGTH_LIMIT.html b/core/docs/variables/INPUT_LENGTH_LIMIT.html index e7a0e8376..1261a514c 100644 --- a/core/docs/variables/INPUT_LENGTH_LIMIT.html +++ b/core/docs/variables/INPUT_LENGTH_LIMIT.html @@ -1 +1 @@ -INPUT_LENGTH_LIMIT | @hpke/core

Variable INPUT_LENGTH_LIMITConst

INPUT_LENGTH_LIMIT: 8192 = 8192
+INPUT_LENGTH_LIMIT | @hpke/core

Variable INPUT_LENGTH_LIMITConst

INPUT_LENGTH_LIMIT: 8192 = 8192
diff --git a/core/docs/variables/KdfId-1.html b/core/docs/variables/KdfId-1.html index 318194cf2..e9984bf10 100644 --- a/core/docs/variables/KdfId-1.html +++ b/core/docs/variables/KdfId-1.html @@ -1,2 +1,2 @@ KdfId | @hpke/core

Variable KdfIdConst

KdfId: {
    HkdfSha256: 1;
    HkdfSha384: 2;
    HkdfSha512: 3;
} = Kdf

The supported Key Derivation Function (KDF) identifiers.

-
+
diff --git a/core/docs/variables/KemId-1.html b/core/docs/variables/KemId-1.html index b4763b2d7..6bcce788e 100644 --- a/core/docs/variables/KemId-1.html +++ b/core/docs/variables/KemId-1.html @@ -1,2 +1,2 @@ KemId | @hpke/core

Variable KemIdConst

KemId: {
    DhkemP256HkdfSha256: 16;
    DhkemP384HkdfSha384: 17;
    DhkemP521HkdfSha512: 18;
    DhkemSecp256k1HkdfSha256: 19;
    DhkemX25519HkdfSha256: 32;
    DhkemX448HkdfSha512: 33;
    HybridkemX25519Kyber768: 48;
    NotAssigned: 0;
} = Kem

The supported Key Encapsulation Mechanism (KEM) identifiers.

-
+
diff --git a/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html b/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html index fc4466c23..c9d8ca304 100644 --- a/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html +++ b/dhkem-secp256k1/docs/classes/DhkemSecp256k1HkdfSha256.html @@ -13,7 +13,7 @@
import { AeadId, CipherSuite, KdfId, KemId } from "https://deno.land/x/hpke/mod.ts";

const suite = new CipherSuite({
kem: KemId.DhkemX25519HkdfSha256,
kdf: KdfId.HkdfSha256,
aead: AeadId.Aes128Gcm,
});
-

Hierarchy

Constructors

Hierarchy

  • Dhkem
    • DhkemX25519HkdfSha256

Constructors

Properties

Constructors

Properties

_kdf: KdfInterface
_prim: DhkemPrimitives
encSize: number = 32

32

-
id: KemId = KemId.DhkemX25519HkdfSha256

KemId.DhkemX25519HkdfSha256 (0x0020)

-
privateKeySize: number = 32

32

-
publicKeySize: number = 32

32

-
secretSize: number = 32

32

-

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

_kdf: KdfInterface
_prim: DhkemPrimitives
encSize: number = 32

32

+
id: KemId = KemId.DhkemX25519HkdfSha256

KemId.DhkemX25519HkdfSha256 (0x0020)

+
privateKeySize: number = 32

32

+
publicKeySize: number = 32

32

+
secretSize: number = 32

32

+

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    • params: RecipientContextParams

      A set of parameters for the recipient context.

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Derives a key pair from the byte string ikm.

    +
  • Derives a key pair from the byte string ikm.

    If the error occurred, throws DeriveKeyPairError.

    Parameters

    • ikm: ArrayBuffer

      An input keying material.

    Returns Promise<CryptoKeyPair>

    A key pair derived.

    DeriveKeyPairError

    -
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    +
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

    DeserializeError

    -
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    +
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

    DeserializeError

    -
  • Generates an ephemeral, fixed-length symmetric key and +

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    • params: SenderContextParams

      A set of parameters for the sender context.

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Generates a key pair.

    +
  • Generates a key pair.

    If the error occurred, throws NotSupportedError.

    Returns Promise<CryptoKeyPair>

    A key pair generated.

    NotSupportedError

    -
  • Imports a public or private key and converts to a CryptoKey.

    +

Returns Promise<CryptoKey>

A public or private CryptoKey.

DeserializeError

-
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    +
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

    SerializeError

    -
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    +
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

    SerializeError

    -
+
diff --git a/dhkem-x25519/docs/classes/HkdfSha256.html b/dhkem-x25519/docs/classes/HkdfSha256.html index c236cec0a..3e0806075 100644 --- a/dhkem-x25519/docs/classes/HkdfSha256.html +++ b/dhkem-x25519/docs/classes/HkdfSha256.html @@ -1,4 +1,4 @@ -HkdfSha256 | @hpke/dhkem-x25519

Hierarchy

  • HkdfSha256
    • HkdfSha256

Constructors

constructor +HkdfSha256 | @hpke/dhkem-x25519

Hierarchy

  • HkdfSha256
    • HkdfSha256

Constructors

Properties

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

-
hashSize: number = 32

32

-
id: KdfId = KdfId.HkdfSha256

KdfId.HkdfSha256 (0x0001)

-

Methods

  • Builds a labeled input keying material.

    +

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

+
hashSize: number = 32

32

+
id: KdfId = KdfId.HkdfSha256

KdfId.HkdfSha256 (0x0001)

+

Methods

  • Builds a labeled input keying material.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

    Returns Uint8Array

    An input keying material as bytes.

    -
  • Builds a labeled info string.

    +
  • Builds a labeled info string.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length of the output byte string.

    Returns Uint8Array

    An info string as bytes.

    -
  • Expands a pseudorandom key prk.

    +
  • Expands a pseudorandom key prk.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Parameters

    • salt: ArrayBuffer
    • ikm: ArrayBuffer

    Returns Promise<ArrayBuffer>

  • Extracts a pseudorandom key and expand it to a specified length keying material.

    +
  • Parameters

    • salt: ArrayBuffer
    • ikm: ArrayBuffer

    Returns Promise<ArrayBuffer>

  • Extracts a pseudorandom key and expand it to a specified length keying material.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Initializes the instance by setting a suite_id defined in RFC9180.

    +
  • Initializes the instance by setting a suite_id defined in RFC9180.

    Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -

    Returns void

  • Extracts a pseudorandom key with label.

    +

Returns void

  • Extracts a pseudorandom key with label.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key with label.

    +
  • Extracts a pseudorandom key with label.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
+
diff --git a/dhkem-x25519/docs/classes/X25519.html b/dhkem-x25519/docs/classes/X25519.html index fdf420eec..94c1f4e02 100644 --- a/dhkem-x25519/docs/classes/X25519.html +++ b/dhkem-x25519/docs/classes/X25519.html @@ -1,4 +1,4 @@ -X25519 | @hpke/dhkem-x25519

Implements

  • DhkemPrimitives

Constructors

constructor +X25519 | @hpke/dhkem-x25519

Implements

  • DhkemPrimitives

Constructors

Methods

  • Parameters

    • ikm: ArrayBuffer

    Returns Promise<CryptoKeyPair>

  • Parameters

    • key: CryptoKey

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • sk: CryptoKey
    • pk: CryptoKey

    Returns Promise<ArrayBuffer>

  • Returns Promise<CryptoKeyPair>

  • Parameters

    • format: "raw" | "jwk"
    • key: ArrayBuffer | JsonWebKey
    • isPublic: boolean

    Returns Promise<CryptoKey>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

+

Constructors

Methods

  • Parameters

    • ikm: ArrayBuffer

    Returns Promise<CryptoKeyPair>

  • Parameters

    • key: CryptoKey

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • sk: CryptoKey
    • pk: CryptoKey

    Returns Promise<ArrayBuffer>

  • Returns Promise<CryptoKeyPair>

  • Parameters

    • format: "raw" | "jwk"
    • key: ArrayBuffer | JsonWebKey
    • isPublic: boolean

    Returns Promise<CryptoKey>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

diff --git a/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html b/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html index 5d2bc44a2..ce27faeb1 100644 --- a/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html +++ b/dhkem-x448/docs/classes/DhkemX448HkdfSha512.html @@ -9,7 +9,7 @@
import {
Aes256Gcm,
CipherSuite,
HkdfSha512,
} from "https://deno.land/x/hpke/core/mod.ts";
import { DhkemX448HkdfSha512 } from "https://deno.land/x/hpke/x/dhkem-x448/mod.ts";

const suite = new CipherSuite({
kem: new DhkemX448HkdfSha512(),
kdf: new HkdfSha512(),
aead: new Aes256Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • Dhkem
    • DhkemX448HkdfSha512

Constructors

Properties

Constructors

Properties

_kdf: KdfInterface
_prim: DhkemPrimitives
encSize: number = 56

56

-
id: KemId = KemId.DhkemX448HkdfSha512

KemId.DhkemX448HkdfSha512 (0x0021)

-
privateKeySize: number = 56

56

-
publicKeySize: number = 56

56

-
secretSize: number = 64

64

-

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

_kdf: KdfInterface
_prim: DhkemPrimitives
encSize: number = 56

56

+
id: KemId = KemId.DhkemX448HkdfSha512

KemId.DhkemX448HkdfSha512 (0x0021)

+
privateKeySize: number = 56

56

+
publicKeySize: number = 56

56

+
secretSize: number = 64

64

+

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    • params: RecipientContextParams

      A set of parameters for the recipient context.

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Derives a key pair from the byte string ikm.

    +
  • Derives a key pair from the byte string ikm.

    If the error occurred, throws DeriveKeyPairError.

    Parameters

    • ikm: ArrayBuffer

      An input keying material.

    Returns Promise<CryptoKeyPair>

    A key pair derived.

    DeriveKeyPairError

    -
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    +
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

    DeserializeError

    -
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    +
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

    DeserializeError

    -
  • Generates an ephemeral, fixed-length symmetric key and +

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    • params: SenderContextParams

      A set of parameters for the sender context.

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Generates a key pair.

    +
  • Generates a key pair.

    If the error occurred, throws NotSupportedError.

    Returns Promise<CryptoKeyPair>

    A key pair generated.

    NotSupportedError

    -
  • Imports a public or private key and converts to a CryptoKey.

    +

Returns Promise<CryptoKey>

A public or private CryptoKey.

DeserializeError

-
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    +
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

    SerializeError

    -
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    +
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

    SerializeError

    -
+
diff --git a/dhkem-x448/docs/classes/HkdfSha512.html b/dhkem-x448/docs/classes/HkdfSha512.html index 4098168b3..65b5770ea 100644 --- a/dhkem-x448/docs/classes/HkdfSha512.html +++ b/dhkem-x448/docs/classes/HkdfSha512.html @@ -1,4 +1,4 @@ -HkdfSha512 | @hpke/dhkem-x448

Hierarchy

  • HkdfSha512
    • HkdfSha512

Constructors

constructor +HkdfSha512 | @hpke/dhkem-x448

Hierarchy

  • HkdfSha512
    • HkdfSha512

Constructors

Properties

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

-
hashSize: number = 64

64

-
id: KdfId = KdfId.HkdfSha512

KdfId.HkdfSha512 (0x0003)

-

Methods

  • Builds a labeled input keying material.

    +

Constructors

Properties

_api: SubtleCrypto = undefined
_suiteId: Uint8Array = EMPTY
algHash: HmacKeyGenParams = ...

The parameters for Web Cryptography API

+
hashSize: number = 64

64

+
id: KdfId = KdfId.HkdfSha512

KdfId.HkdfSha512 (0x0003)

+

Methods

  • Builds a labeled input keying material.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

    Returns Uint8Array

    An input keying material as bytes.

    -
  • Builds a labeled info string.

    +
  • Builds a labeled info string.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length of the output byte string.

    Returns Uint8Array

    An info string as bytes.

    -
  • Expands a pseudorandom key prk.

    +
  • Expands a pseudorandom key prk.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Parameters

    • salt: ArrayBuffer
    • ikm: ArrayBuffer

    Returns Promise<ArrayBuffer>

  • Extracts a pseudorandom key and expand it to a specified length keying material.

    +
  • Parameters

    • salt: ArrayBuffer
    • ikm: ArrayBuffer

    Returns Promise<ArrayBuffer>

  • Extracts a pseudorandom key and expand it to a specified length keying material.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Initializes the instance by setting a suite_id defined in RFC9180.

    +
  • Initializes the instance by setting a suite_id defined in RFC9180.

    Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -

    Returns void

  • Extracts a pseudorandom key with label.

    +

Returns void

  • Extracts a pseudorandom key with label.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key with label.

    +
  • Extracts a pseudorandom key with label.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
+
diff --git a/dhkem-x448/docs/classes/X448.html b/dhkem-x448/docs/classes/X448.html index 2fdf79053..a967dec70 100644 --- a/dhkem-x448/docs/classes/X448.html +++ b/dhkem-x448/docs/classes/X448.html @@ -1,4 +1,4 @@ -X448 | @hpke/dhkem-x448

Implements

  • DhkemPrimitives

Constructors

constructor +X448 | @hpke/dhkem-x448

Implements

  • DhkemPrimitives

Constructors

Methods

  • Parameters

    • ikm: ArrayBuffer

    Returns Promise<CryptoKeyPair>

  • Parameters

    • key: CryptoKey

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • sk: CryptoKey
    • pk: CryptoKey

    Returns Promise<ArrayBuffer>

  • Returns Promise<CryptoKeyPair>

  • Parameters

    • format: "raw" | "jwk"
    • key: ArrayBuffer | JsonWebKey
    • isPublic: boolean

    Returns Promise<CryptoKey>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

+

Constructors

Methods

  • Parameters

    • ikm: ArrayBuffer

    Returns Promise<CryptoKeyPair>

  • Parameters

    • key: CryptoKey

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • key: ArrayBuffer

    Returns Promise<CryptoKey>

  • Parameters

    • sk: CryptoKey
    • pk: CryptoKey

    Returns Promise<ArrayBuffer>

  • Returns Promise<CryptoKeyPair>

  • Parameters

    • format: "raw" | "jwk"
    • key: ArrayBuffer | JsonWebKey
    • isPublic: boolean

    Returns Promise<CryptoKey>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

  • Parameters

    • key: CryptoKey

    Returns Promise<ArrayBuffer>

diff --git a/docs/classes/BaseError.html b/docs/classes/BaseError.html index a0c831bf5..7af5304f7 100644 --- a/docs/classes/BaseError.html +++ b/docs/classes/BaseError.html @@ -1,7 +1,7 @@ BaseError | @hpke/hpke-js

The base error class of hpke-js.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/CipherSuite.html b/docs/classes/CipherSuite.html index ae72e4125..d4d26b52d 100644 --- a/docs/classes/CipherSuite.html +++ b/docs/classes/CipherSuite.html @@ -31,7 +31,7 @@
import { AeadId, CipherSuite, KdfId } from "http://deno.land/x/hpke/mod.ts";
// Use an extension module.
import {
HybridkemX25519Kyber768,
} from "https://deno.land/x/hpke/x/hybridkem-x25519-kyber768/mod.ts";

const suite = new CipherSuite({
kem: new HybridkemX25519Kyber768(),
kdf: KdfId.HkdfSha256,
aead: AeadId.Aes128Gcm,
});
-

Hierarchy

Constructors

Hierarchy

  • CipherSuite
    • CipherSuite

Constructors

Properties

Accessors

aead @@ -47,33 +47,33 @@

Constructors

Properties

_api: SubtleCrypto = undefined

Accessors

Methods

Properties

_api: SubtleCrypto = undefined

Accessors

Methods

  • Derives a key pair for the cipher suite in the manner +

  • Generates a key pair for the cipher suite.

    +
  • Imports a public or private key and converts to a CryptoKey.

    +
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -86,18 +86,18 @@

Returns Promise<CryptoKey>

A public or private CryptoKey.

Use KemInterface.generateKeyPair instead.

DeserializeError

-
  • Decrypts a message from a sender.

    +
  • Decrypts a message from a sender.

    If the error occurred, throws DecapError | DeserializeError | OpenError | ValidationError.

    Parameters

    • params: RecipientContextParams

      A set of parameters for building a recipient encryption context.

    • ct: ArrayBuffer

      An encrypted text as bytes to be decrypted.

    • aad: ArrayBuffer = EMPTY

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

+
diff --git a/docs/classes/DecapError.html b/docs/classes/DecapError.html index c1b9acf8e..79e48bfa8 100644 --- a/docs/classes/DecapError.html +++ b/docs/classes/DecapError.html @@ -1,7 +1,7 @@ DecapError | @hpke/hpke-js

Class DecapError

decap() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/DeriveKeyPairError.html b/docs/classes/DeriveKeyPairError.html index 7d2a222f3..b7bc1b1b4 100644 --- a/docs/classes/DeriveKeyPairError.html +++ b/docs/classes/DeriveKeyPairError.html @@ -1,7 +1,7 @@ DeriveKeyPairError | @hpke/hpke-js

Class DeriveKeyPairError

Key pair derivation failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/DeserializeError.html b/docs/classes/DeserializeError.html index 098a388f5..681e91ae6 100644 --- a/docs/classes/DeserializeError.html +++ b/docs/classes/DeserializeError.html @@ -1,7 +1,7 @@ DeserializeError | @hpke/hpke-js

Class DeserializeError

Public or private key deserialization failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/EncapError.html b/docs/classes/EncapError.html index fa05f4fbd..95dd43fdf 100644 --- a/docs/classes/EncapError.html +++ b/docs/classes/EncapError.html @@ -1,7 +1,7 @@ EncapError | @hpke/hpke-js

Class EncapError

encap() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/ExportError.html b/docs/classes/ExportError.html index 73c1354fd..f4d09544e 100644 --- a/docs/classes/ExportError.html +++ b/docs/classes/ExportError.html @@ -1,7 +1,7 @@ ExportError | @hpke/hpke-js

Class ExportError

Secret export failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/HpkeError.html b/docs/classes/HpkeError.html index 3fe4d20e5..b8c8faa6e 100644 --- a/docs/classes/HpkeError.html +++ b/docs/classes/HpkeError.html @@ -1,7 +1,7 @@ HpkeError | @hpke/hpke-js

The base error class of hpke-js.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/InvalidParamError.html b/docs/classes/InvalidParamError.html index 1a7b24c25..2ffea0d7a 100644 --- a/docs/classes/InvalidParamError.html +++ b/docs/classes/InvalidParamError.html @@ -1,7 +1,7 @@ InvalidParamError | @hpke/hpke-js

Class InvalidParamError

Invalid parameter.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/MessageLimitReachedError.html b/docs/classes/MessageLimitReachedError.html index 812ed816a..653d5adca 100644 --- a/docs/classes/MessageLimitReachedError.html +++ b/docs/classes/MessageLimitReachedError.html @@ -1,7 +1,7 @@ MessageLimitReachedError | @hpke/hpke-js

Class MessageLimitReachedError

Sequence number overflow on the encryption context.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/NotSupportedError.html b/docs/classes/NotSupportedError.html index c604922f7..4e78d895c 100644 --- a/docs/classes/NotSupportedError.html +++ b/docs/classes/NotSupportedError.html @@ -1,7 +1,7 @@ NotSupportedError | @hpke/hpke-js

Class NotSupportedError

Not supported failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/OpenError.html b/docs/classes/OpenError.html index c11dcc904..f6ec34bc8 100644 --- a/docs/classes/OpenError.html +++ b/docs/classes/OpenError.html @@ -1,7 +1,7 @@ OpenError | @hpke/hpke-js

open() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/SealError.html b/docs/classes/SealError.html index 5b5ad2602..588e51cb0 100644 --- a/docs/classes/SealError.html +++ b/docs/classes/SealError.html @@ -1,7 +1,7 @@ SealError | @hpke/hpke-js

seal() failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/SerializeError.html b/docs/classes/SerializeError.html index 7f798ec91..a1f6ab5a2 100644 --- a/docs/classes/SerializeError.html +++ b/docs/classes/SerializeError.html @@ -1,7 +1,7 @@ SerializeError | @hpke/hpke-js

Class SerializeError

Public or private key serialization failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/classes/ValidationError.html b/docs/classes/ValidationError.html index 5a38fe57b..a728a3439 100644 --- a/docs/classes/ValidationError.html +++ b/docs/classes/ValidationError.html @@ -1,7 +1,7 @@ ValidationError | @hpke/hpke-js

Class ValidationError

KEM input or output validation failure.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
+

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string
diff --git a/docs/interfaces/AeadEncryptionContext.html b/docs/interfaces/AeadEncryptionContext.html index 61c861df9..146310a74 100644 --- a/docs/interfaces/AeadEncryptionContext.html +++ b/docs/interfaces/AeadEncryptionContext.html @@ -1,14 +1,14 @@ AeadEncryptionContext | @hpke/hpke-js

Interface AeadEncryptionContext

The AEAD encryption context interface.

-
interface AeadEncryptionContext {
    open(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
    seal(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
}

Methods

interface AeadEncryptionContext {
    open(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
    seal(iv: ArrayBuffer, data: ArrayBuffer, aad: ArrayBuffer): Promise<ArrayBuffer>;
}

Methods

Methods

  • Decrypts data with an initialization vector and additional authenticated data.

    Parameters

    • iv: ArrayBuffer

      An initialization vector.

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

    • aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    -
  • Encrypts data with an initialization vector and additional authenticated data.

    Parameters

    • iv: ArrayBuffer

      An initialization vector.

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

    • aad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

    -
+
diff --git a/docs/interfaces/AeadInterface.html b/docs/interfaces/AeadInterface.html index 9f0c4dd9b..38516a653 100644 --- a/docs/interfaces/AeadInterface.html +++ b/docs/interfaces/AeadInterface.html @@ -1,14 +1,14 @@ AeadInterface | @hpke/hpke-js

Interface AeadInterface

The AEAD interface.

-
interface AeadInterface {
    id: AeadId;
    keySize: number;
    nonceSize: number;
    tagSize: number;
    createEncryptionContext(key: ArrayBuffer): AeadEncryptionContext;
}

Properties

id +
interface AeadInterface {
    id: AeadId;
    keySize: number;
    nonceSize: number;
    tagSize: number;
    createEncryptionContext(key: ArrayBuffer): AeadEncryptionContext;
}

Properties

id: AeadId

The KDF identifier.

-
keySize: number

The length in bytes of an AEAD key (Nk).

-
nonceSize: number

The length in bytes of an AEAD nonce (Nn).

-
tagSize: number

The length in bytes of an AEAD authentication tag (Nt).

-

Methods

keySize: number

The length in bytes of an AEAD key (Nk).

+
nonceSize: number

The length in bytes of an AEAD nonce (Nn).

+
tagSize: number

The length in bytes of an AEAD authentication tag (Nt).

+

Methods

+
diff --git a/docs/interfaces/CipherSuiteParams.html b/docs/interfaces/CipherSuiteParams.html index 2d318f76c..a6287873b 100644 --- a/docs/interfaces/CipherSuiteParams.html +++ b/docs/interfaces/CipherSuiteParams.html @@ -1,8 +1,8 @@ CipherSuiteParams | @hpke/hpke-js

Interface CipherSuiteParams

The parameters used to configure the CipherSuite.

-
interface CipherSuiteParams {
    aead: AeadId | AeadInterface;
    kdf: KdfId | KdfInterface;
    kem: KemId | KemInterface;
}

Properties

interface CipherSuiteParams {
    aead: AeadId | AeadInterface;
    kdf: KdfId | KdfInterface;
    kem: KemId | KemInterface;
}

Properties

Properties

The AEAD (Authenticated Encryption with Addtional Data) identifier or the AEAD object.

-

The KDF (Key Derivation Function) identifier or the KDF object.

-

The KEM (Key Encapsulation Mechanism) identifier or the KEM object.

-
+

The KDF (Key Derivation Function) identifier or the KDF object.

+

The KEM (Key Encapsulation Mechanism) identifier or the KEM object.

+
diff --git a/docs/interfaces/CipherSuiteSealResponse.html b/docs/interfaces/CipherSuiteSealResponse.html index 10178a8b8..471e6eb67 100644 --- a/docs/interfaces/CipherSuiteSealResponse.html +++ b/docs/interfaces/CipherSuiteSealResponse.html @@ -1,6 +1,6 @@ CipherSuiteSealResponse | @hpke/hpke-js

Interface CipherSuiteSealResponse

The response of the single-shot seal API.

-
interface CipherSuiteSealResponse {
    ct: ArrayBuffer;
    enc: ArrayBuffer;
}

Properties

ct +
interface CipherSuiteSealResponse {
    ct: ArrayBuffer;
    enc: ArrayBuffer;
}

Properties

Properties

ct: ArrayBuffer

The ciphertext as bytes.

-
enc: ArrayBuffer

The encapsulated key.

-
+
enc: ArrayBuffer

The encapsulated key.

+
diff --git a/docs/interfaces/EncryptionContext.html b/docs/interfaces/EncryptionContext.html index 7ac949eef..21a3e25e2 100644 --- a/docs/interfaces/EncryptionContext.html +++ b/docs/interfaces/EncryptionContext.html @@ -1,5 +1,5 @@ EncryptionContext | @hpke/hpke-js

Interface EncryptionContext

The encryption context interface for a recipient and a sender.

-
interface EncryptionContext {
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Methods

interface EncryptionContext {
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Methods

Methods

  • Exports a secret using a variable-length pseudorandom function.

    @@ -8,16 +8,16 @@
  • len: number

    A desired length in bytes of the output secret.

Returns Promise<ArrayBuffer>

A secret string as bytes.

ExportError

-
  • Decrypts data.

    If the error occurred, throws OpenError.

    Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

    • Optionalaad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    OpenError

    -
  • Encrypts data.

    If the error occurred, throws SealError | MessageLimitReachedError.

    Parameters

    • data: ArrayBuffer

      A plain text as bytes to be encrypted.

    • Optionalaad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A cipher text as bytes.

+
diff --git a/docs/interfaces/KdfInterface.html b/docs/interfaces/KdfInterface.html index 935f2560c..840b8e341 100644 --- a/docs/interfaces/KdfInterface.html +++ b/docs/interfaces/KdfInterface.html @@ -1,5 +1,5 @@ KdfInterface | @hpke/hpke-js

Interface KdfInterface

The KDF interface.

-
interface KdfInterface {
    hashSize: number;
    id: KdfId;
    buildLabeledIkm(label: Uint8Array, ikm: Uint8Array): Uint8Array;
    buildLabeledInfo(label: Uint8Array, info: Uint8Array, len: number): Uint8Array;
    expand(prk: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    extract(salt: ArrayBuffer, ikm: ArrayBuffer): Promise<ArrayBuffer>;
    extractAndExpand(salt: ArrayBuffer, ikm: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    init(suiteId: Uint8Array): void;
    labeledExpand(prk: ArrayBuffer, label: Uint8Array, info: Uint8Array, len: number): Promise<ArrayBuffer>;
    labeledExtract(salt: ArrayBuffer, label: Uint8Array, ikm: Uint8Array): Promise<ArrayBuffer>;
}

Properties

interface KdfInterface {
    hashSize: number;
    id: KdfId;
    buildLabeledIkm(label: Uint8Array, ikm: Uint8Array): Uint8Array;
    buildLabeledInfo(label: Uint8Array, info: Uint8Array, len: number): Uint8Array;
    expand(prk: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    extract(salt: ArrayBuffer, ikm: ArrayBuffer): Promise<ArrayBuffer>;
    extractAndExpand(salt: ArrayBuffer, ikm: ArrayBuffer, info: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    init(suiteId: Uint8Array): void;
    labeledExpand(prk: ArrayBuffer, label: Uint8Array, info: Uint8Array, len: number): Promise<ArrayBuffer>;
    labeledExtract(salt: ArrayBuffer, label: Uint8Array, ikm: Uint8Array): Promise<ArrayBuffer>;
}

Properties

hashSize: number

The output size of the extract() function in bytes (Nh).

-
id: KdfId

The KDF identifier.

-

Methods

id: KdfId

The KDF identifier.

+

Methods

  • Builds a labeled input keying material.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

    Returns Uint8Array

    An input keying material as bytes.

    -
  • Builds a labeled info string.

    Parameters

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length of the output byte string.

    Returns Uint8Array

    An info string as bytes.

    -
  • Expands a pseudorandom key prk.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key of fixed length (Nh) bytes.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
  • Extracts a pseudorandom key and expand it to a specified length keying material.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • ikm: ArrayBuffer

      An input keying material

    • info: ArrayBuffer

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Initializes the instance by setting a suite_id defined in RFC9180.

    Parameters

    • suiteId: Uint8Array

      A suite_id defined in RFC9180.

      -

    Returns void

  • Extracts a pseudorandom key with label.

    +

Returns void

  • Extracts a pseudorandom key with label.

    Parameters

    • prk: ArrayBuffer

      A pseudorandom key.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • info: Uint8Array

      An additional byte string.

    • len: number

      The length in bytes of the output keying material.

    Returns Promise<ArrayBuffer>

    An output keying material as bytes.

    -
  • Extracts a pseudorandom key with label.

    Parameters

    • salt: ArrayBuffer

      An additional random byte string.

    • label: Uint8Array

      A byte string indicating the cryptographic context/operation.

    • ikm: Uint8Array

      An input keying material

    Returns Promise<ArrayBuffer>

    A pseudorandom key as bytes.

    -
+
diff --git a/docs/interfaces/KemInterface.html b/docs/interfaces/KemInterface.html index b8a497520..ec7f79971 100644 --- a/docs/interfaces/KemInterface.html +++ b/docs/interfaces/KemInterface.html @@ -1,5 +1,5 @@ KemInterface | @hpke/hpke-js

Interface KemInterface

The KEM interface.

-
interface KemInterface {
    encSize: number;
    id: KemId;
    privateKeySize: number;
    publicKeySize: number;
    secretSize: number;
    decap(params: RecipientContextParams): Promise<ArrayBuffer>;
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    encap(params: SenderContextParams): Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic?: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Properties

interface KemInterface {
    encSize: number;
    id: KemId;
    privateKeySize: number;
    publicKeySize: number;
    secretSize: number;
    decap(params: RecipientContextParams): Promise<ArrayBuffer>;
    deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>;
    deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>;
    deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>;
    encap(params: SenderContextParams): Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>;
    generateKeyPair(): Promise<CryptoKeyPair>;
    importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic?: boolean): Promise<CryptoKey>;
    serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>;
    serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>;
}

Properties

encSize: number

The length in bytes of an encapsulated key produced by this KEM (Nenc).

-
id: KemId

The KEM identifier.

-
privateKeySize: number

The length in bytes of an encoded private key for this KEM (Nsk).

-
publicKeySize: number

The length in bytes of an encoded public key for this KEM (Npk).

-
secretSize: number

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

-

Methods

id: KemId

The KEM identifier.

+
privateKeySize: number

The length in bytes of an encoded private key for this KEM (Nsk).

+
publicKeySize: number

The length in bytes of an encoded public key for this KEM (Npk).

+
secretSize: number

The length in bytes of a KEM shared secret produced by this KEM (Nsecret).

+

Methods

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -61,14 +61,14 @@
  • OptionalisPublic: boolean

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

+
diff --git a/docs/interfaces/PreSharedKey.html b/docs/interfaces/PreSharedKey.html index 3d06e4073..5e1e393a4 100644 --- a/docs/interfaces/PreSharedKey.html +++ b/docs/interfaces/PreSharedKey.html @@ -1,6 +1,6 @@ PreSharedKey | @hpke/hpke-js

Interface PreSharedKey

The pre-shared key interface.

-
interface PreSharedKey {
    id: ArrayBuffer;
    key: ArrayBuffer;
}

Properties

id +
interface PreSharedKey {
    id: ArrayBuffer;
    key: ArrayBuffer;
}

Properties

Properties

id: ArrayBuffer

The key identifier.

-
key: ArrayBuffer

The body of the pre-shared key.

-
+
key: ArrayBuffer

The body of the pre-shared key.

+
diff --git a/docs/interfaces/RecipientContextParams.html b/docs/interfaces/RecipientContextParams.html index f83fe2064..e7d3f9f29 100644 --- a/docs/interfaces/RecipientContextParams.html +++ b/docs/interfaces/RecipientContextParams.html @@ -1,13 +1,13 @@ RecipientContextParams | @hpke/hpke-js

Interface RecipientContextParams

The parameters used to setup the RecipientContext.

-
interface RecipientContextParams {
    enc: ArrayBuffer;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientKey: CryptoKeyPair | CryptoKey;
    senderPublicKey?: CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • RecipientContextParams

Properties

enc +
interface RecipientContextParams {
    enc: ArrayBuffer;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientKey: CryptoKeyPair | CryptoKey;
    senderPublicKey?: CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • RecipientContextParams

Properties

enc: ArrayBuffer

A byte string of the encapsulated key received from a sender.

-
info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

-

A pre-shared key (PSK) held by both the sender and recipient. +

info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

+

A pre-shared key (PSK) held by both the sender and recipient. The PSK should have at least 32 bytes :and the maxmum length of the PSK is 128 bytes.

-
recipientKey: CryptoKeyPair | CryptoKey

A recipient private key or a key pair.

-
senderPublicKey?: CryptoKey

A sender public key for Auth mode.

-
+
recipientKey: CryptoKeyPair | CryptoKey

A recipient private key or a key pair.

+
senderPublicKey?: CryptoKey

A sender public key for Auth mode.

+
diff --git a/docs/interfaces/SenderContext.html b/docs/interfaces/SenderContext.html index d71cc2068..513b516a4 100644 --- a/docs/interfaces/SenderContext.html +++ b/docs/interfaces/SenderContext.html @@ -1,25 +1,25 @@ SenderContext | @hpke/hpke-js

Interface SenderContext

The sender encryption context.

-
interface SenderContext {
    enc: ArrayBuffer;
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Properties

enc +
interface SenderContext {
    enc: ArrayBuffer;
    export(exporterContext: ArrayBuffer, len: number): Promise<ArrayBuffer>;
    open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
    seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>;
}

Hierarchy (view full)

Properties

Methods

Properties

enc: ArrayBuffer

The encapsulated key generated by the sender.

-

Methods

Methods

  • Exports a secret using a variable-length pseudorandom function.

    If the error occurred, throws ExportError.

    Parameters

    • exporterContext: ArrayBuffer

      An exporter context string as bytes. The maximum length is 128 bytes.

    • len: number

      A desired length in bytes of the output secret.

    Returns Promise<ArrayBuffer>

    A secret string as bytes.

    ExportError

    -
  • Decrypts data.

    If the error occurred, throws OpenError.

    Parameters

    • data: ArrayBuffer

      An encrypted text as bytes to be decrypted.

    • Optionalaad: ArrayBuffer

      Additional authenticated data as bytes fed by an application.

    Returns Promise<ArrayBuffer>

    A decrypted plain text as bytes.

    OpenError

    -
+
diff --git a/docs/interfaces/SenderContextParams.html b/docs/interfaces/SenderContextParams.html index 3df5dcca4..8944f4dc1 100644 --- a/docs/interfaces/SenderContextParams.html +++ b/docs/interfaces/SenderContextParams.html @@ -1,13 +1,13 @@ SenderContextParams | @hpke/hpke-js

Interface SenderContextParams

The parameters used to setup the SenderContext.

-
interface SenderContextParams {
    ekm?: ArrayBuffer | CryptoKeyPair;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientPublicKey: CryptoKey;
    senderKey?: CryptoKeyPair | CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • SenderContextParams

Properties

interface SenderContextParams {
    ekm?: ArrayBuffer | CryptoKeyPair;
    info?: ArrayBuffer;
    psk?: PreSharedKey;
    recipientPublicKey: CryptoKey;
    senderKey?: CryptoKeyPair | CryptoKey;
}

Hierarchy

  • KeyScheduleParams
    • SenderContextParams

Properties

ekm?: ArrayBuffer | CryptoKeyPair

DO NOT USE. FOR DEBUGGING/TESTING PURPOSES ONLY.

-
info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

-

A pre-shared key (PSK) held by both the sender and recipient. +

info?: ArrayBuffer

Application supplied information. The maximum length is 128 bytes.

+

A pre-shared key (PSK) held by both the sender and recipient. The PSK should have at least 32 bytes :and the maxmum length of the PSK is 128 bytes.

-
recipientPublicKey: CryptoKey

A recipient public key.

-
senderKey?: CryptoKeyPair | CryptoKey

A sender private key or a key pair for Auth mode.

-
+
recipientPublicKey: CryptoKey

A recipient public key.

+
senderKey?: CryptoKeyPair | CryptoKey

A sender private key or a key pair for Auth mode.

+
diff --git a/docs/types/Aead.html b/docs/types/Aead.html index 9713a3769..eb0d13172 100644 --- a/docs/types/Aead.html +++ b/docs/types/Aead.html @@ -1,3 +1,3 @@ Aead | @hpke/hpke-js

Type Alias Aead

Aead: typeof Aead[keyof typeof Aead]

The type alias of the supported AEAD identifiers.

Use AeadId instead.

-
+
diff --git a/docs/types/AeadId.html b/docs/types/AeadId.html index f73f5a556..6a75d728c 100644 --- a/docs/types/AeadId.html +++ b/docs/types/AeadId.html @@ -1,2 +1,2 @@ AeadId | @hpke/hpke-js

Type Alias AeadId

AeadId: typeof AeadId[keyof typeof AeadId]

The type alias of the supported AEAD identifiers.

-
+
diff --git a/docs/types/Kdf.html b/docs/types/Kdf.html index 609db4431..1b0a54919 100644 --- a/docs/types/Kdf.html +++ b/docs/types/Kdf.html @@ -1,3 +1,3 @@ Kdf | @hpke/hpke-js

Type Alias Kdf

Kdf: typeof Kdf[keyof typeof Kdf]

The type alias of the supported KDF identifiers.

Use KdfId instead.

-
+
diff --git a/docs/types/KdfId.html b/docs/types/KdfId.html index 9006dd2e8..f7d81ed8d 100644 --- a/docs/types/KdfId.html +++ b/docs/types/KdfId.html @@ -1,2 +1,2 @@ KdfId | @hpke/hpke-js

Type Alias KdfId

KdfId: typeof KdfId[keyof typeof KdfId]

The type alias of the supported KDF identifiers.

-
+
diff --git a/docs/types/Kem.html b/docs/types/Kem.html index 3cc3e07cf..517d7f6a0 100644 --- a/docs/types/Kem.html +++ b/docs/types/Kem.html @@ -1,3 +1,3 @@ Kem | @hpke/hpke-js

Type Alias Kem

Kem: typeof Kem[keyof typeof Kem]

The type alias of the supported KEM identifiers.

Use KdfId instead.

-
+
diff --git a/docs/types/KemId.html b/docs/types/KemId.html index 9de13109a..12034d3d3 100644 --- a/docs/types/KemId.html +++ b/docs/types/KemId.html @@ -1,2 +1,2 @@ KemId | @hpke/hpke-js

Type Alias KemId

KemId: typeof KemId[keyof typeof KemId]

The type alias of the supported KEM identifiers.

-
+
diff --git a/docs/types/RecipientContext.html b/docs/types/RecipientContext.html index 3da82001d..e71d69fe1 100644 --- a/docs/types/RecipientContext.html +++ b/docs/types/RecipientContext.html @@ -1,2 +1,2 @@ RecipientContext | @hpke/hpke-js

Type Alias RecipientContext

RecipientContext: EncryptionContext

The recipient encryption context.

-
+
diff --git a/docs/variables/Aead-1.html b/docs/variables/Aead-1.html index 92b64f1f6..f1ee8f4c1 100644 --- a/docs/variables/Aead-1.html +++ b/docs/variables/Aead-1.html @@ -1,3 +1,3 @@ Aead | @hpke/hpke-js

Variable AeadConst

Aead: {
    Aes128Gcm: 1;
    Aes256Gcm: 2;
    Chacha20Poly1305: 3;
    ExportOnly: 65535;
} = ...

The supported Authenticated Encryption with Associated Data (AEAD) identifiers.

Use AeadId instead.

-
+
diff --git a/docs/variables/AeadId-1.html b/docs/variables/AeadId-1.html index 9531f9dea..117ba0978 100644 --- a/docs/variables/AeadId-1.html +++ b/docs/variables/AeadId-1.html @@ -1,2 +1,2 @@ AeadId | @hpke/hpke-js

Variable AeadIdConst

AeadId: {
    Aes128Gcm: 1;
    Aes256Gcm: 2;
    Chacha20Poly1305: 3;
    ExportOnly: 65535;
} = Aead

The supported Authenticated Encryption with Associated Data (AEAD) identifiers.

-
+
diff --git a/docs/variables/Kdf-1.html b/docs/variables/Kdf-1.html index 048ce29d3..5544d7a34 100644 --- a/docs/variables/Kdf-1.html +++ b/docs/variables/Kdf-1.html @@ -1,3 +1,3 @@ Kdf | @hpke/hpke-js

Variable KdfConst

Kdf: {
    HkdfSha256: 1;
    HkdfSha384: 2;
    HkdfSha512: 3;
} = ...

The supported Key Derivation Function (KDF) identifiers.

Use KdfId instead.

-
+
diff --git a/docs/variables/KdfId-1.html b/docs/variables/KdfId-1.html index 9c9b1a0c0..6e87b2f72 100644 --- a/docs/variables/KdfId-1.html +++ b/docs/variables/KdfId-1.html @@ -1,2 +1,2 @@ KdfId | @hpke/hpke-js

Variable KdfIdConst

KdfId: {
    HkdfSha256: 1;
    HkdfSha384: 2;
    HkdfSha512: 3;
} = Kdf

The supported Key Derivation Function (KDF) identifiers.

-
+
diff --git a/docs/variables/Kem-1.html b/docs/variables/Kem-1.html index e328e6442..2e66792ea 100644 --- a/docs/variables/Kem-1.html +++ b/docs/variables/Kem-1.html @@ -1,3 +1,3 @@ Kem | @hpke/hpke-js

Variable KemConst

Kem: {
    DhkemP256HkdfSha256: 16;
    DhkemP384HkdfSha384: 17;
    DhkemP521HkdfSha512: 18;
    DhkemSecp256k1HkdfSha256: 19;
    DhkemX25519HkdfSha256: 32;
    DhkemX448HkdfSha512: 33;
    HybridkemX25519Kyber768: 48;
    NotAssigned: 0;
} = ...

The supported Key Encapsulation Mechanism (KEM) identifiers.

Use KdfId instead.

-
+
diff --git a/docs/variables/KemId-1.html b/docs/variables/KemId-1.html index 4b1b04bc8..ce7b92ad0 100644 --- a/docs/variables/KemId-1.html +++ b/docs/variables/KemId-1.html @@ -1,2 +1,2 @@ KemId | @hpke/hpke-js

Variable KemIdConst

KemId: {
    DhkemP256HkdfSha256: 16;
    DhkemP384HkdfSha384: 17;
    DhkemP521HkdfSha512: 18;
    DhkemSecp256k1HkdfSha256: 19;
    DhkemX25519HkdfSha256: 32;
    DhkemX448HkdfSha512: 33;
    HybridkemX25519Kyber768: 48;
    NotAssigned: 0;
} = Kem

The supported Key Encapsulation Mechanism (KEM) identifiers.

-
+
diff --git a/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html b/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html index f95943dd7..250a3cb7f 100644 --- a/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html +++ b/hybridkem-x25519-kyber768/docs/classes/HybridkemX25519Kyber768.html @@ -6,7 +6,7 @@
import { Aes128Gcm, CipherSuite, HkdfSha256 } from "http://deno.land/x/hpke/core/mod.ts";
import { HybridkemX25519Kyber768 } from "https://deno.land/x/hpke/x/hybridkem-x25519-kyber768/mod.ts";
const suite = new CipherSuite({
kem: new HybridkemX25519Kyber768(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
});
-

Hierarchy

Constructors

Hierarchy

  • Hybridkem
    • HybridkemX25519Kyber768

Constructors

Properties

Constructors

Properties

_a: DhkemInterface
_b: KemInterface
_kdf: KdfInterface
auth: boolean = false
encSize: number = 1120
id: KemId = KemId.HybridkemX25519Kyber768
name: string = "X25519Kyber25519"
privateKeySize: number = 2432
publicKeySize: number = 1216
secretSize: number = 64

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    +

Constructors

Properties

_a: DhkemInterface
_b: KemInterface
_kdf: KdfInterface
auth: boolean = false
encSize: number = 1120
id: KemId = KemId.HybridkemX25519Kyber768
name: string = "X25519Kyber25519"
privateKeySize: number = 2432
publicKeySize: number = 1216
secretSize: number = 64

Methods

  • Recovers the ephemeral symmetric key from its encapsulated representation enc.

    If the error occurred, throws DecapError.

    Parameters

    • params: RecipientContextParams

      A set of parameters for the recipient context.

    Returns Promise<ArrayBuffer>

    A shared secret as the output of the decapsulation step.

    DecapError

    -
  • Derives a key pair from the byte string ikm.

    +
  • Derives a key pair from the byte string ikm.

    If the error occurred, throws DeriveKeyPairError.

    Parameters

    • ikm: ArrayBuffer

      An input keying material.

    Returns Promise<CryptoKeyPair>

    A key pair derived.

    DeriveKeyPairError

    -
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    +
  • Deserializes a private key as a byte string of length Nsk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

    DeserializeError

    -
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    +
  • Deserializes a public key as a byte string of length Npk to CryptoKey.

    If the error occurred, throws DeserializeError.

    Parameters

    • key: ArrayBuffer

      A key as bytes.

    Returns Promise<CryptoKey>

    A CryptoKey.

    DeserializeError

    -
  • Generates an ephemeral, fixed-length symmetric key and +

  • Generates an ephemeral, fixed-length symmetric key and a fixed-length encapsulation of the key that can be decapsulated by the holder of the private key corresponding to pkR.

    If the error occurred, throws EncapError.

    Parameters

    • params: SenderContextParams

      A set of parameters for the sender context.

    Returns Promise<{
        enc: ArrayBuffer;
        sharedSecret: ArrayBuffer;
    }>

    A shared secret and an encapsulated key as the output of the encapsulation step.

    EncapError

    -
  • Generates a key pair.

    If the error occurred, throws NotSupportedError.

    Returns Promise<CryptoKeyPair>

    A key pair generated.

    NotSupportedError

    -
  • Imports a public or private key and converts to a CryptoKey.

    +
  • Imports a public or private key and converts to a CryptoKey.

    Since key parameters for createSenderContext or createRecipientContext are CryptoKey format, you have to use this function to convert provided keys to CryptoKey.

    @@ -69,14 +69,14 @@
  • isPublic: boolean = true

    The indicator whether the provided key is a public key or not, which is used only for 'raw' format.

Returns Promise<CryptoKey>

A public or private CryptoKey.

DeserializeError

-
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    +
  • Serializes a private key as CryptoKey to a byte string of length Nsk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

    SerializeError

    -
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    +
  • Serializes a public key as CryptoKey to a byte string of length Npk.

    If the error occurred, throws SerializeError.

    Parameters

    • key: CryptoKey

      A CryptoKey.

    Returns Promise<ArrayBuffer>

    A key as bytes.

    SerializeError

    -
+