/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_SubtleCryptoBinding_h
#define mozilla_dom_SubtleCryptoBinding_h

#include "SubtleCryptoBinding.h"
#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CryptoKey.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/UnionTypes.h"

namespace mozilla {
namespace dom {

struct AesCbcParamsAtoms;
struct AesCtrParamsAtoms;
struct AesDerivedKeyParamsAtoms;
struct AesGcmParamsAtoms;
struct AesKeyGenParamsAtoms;
struct AlgorithmAtoms;
class ArrayBufferViewOrArrayBuffer;
class CryptoKey;
struct CryptoKeyAtoms;
struct CryptoKeyPairAtoms;
struct DhImportKeyParamsAtoms;
struct DhKeyDeriveParamsAtoms;
struct DhKeyGenParamsAtoms;
struct EcKeyGenParamsAtoms;
struct EcdhKeyDeriveParamsAtoms;
struct EcdsaParamsAtoms;
struct HmacDerivedKeyParamsAtoms;
struct HmacImportParamsAtoms;
struct HmacKeyGenParamsAtoms;
struct JsonWebKeyAtoms;
struct NativePropertyHooks;
class ObjectOrString;
class OwningArrayBufferViewOrArrayBuffer;
class OwningObjectOrString;
struct Pbkdf2ParamsAtoms;
class ProtoAndIfaceCache;
struct RsaHashedImportParamsAtoms;
struct RsaHashedKeyGenParamsAtoms;
struct RsaOaepParamsAtoms;
struct RsaOtherPrimesInfo;
struct RsaOtherPrimesInfoAtoms;
class SubtleCrypto;
struct SubtleCryptoAtoms;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct Algorithm : public DictionaryBase
{
  nsString mName;

  Algorithm();

  explicit inline Algorithm(const Algorithm& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline Algorithm(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, AlgorithmAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const Algorithm& aOther);
};

namespace binding_detail {
struct FastAlgorithm : public Algorithm
{
  inline FastAlgorithm()
    : Algorithm(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct CryptoKeyPair : public DictionaryBase
{
  OwningNonNull<mozilla::dom::CryptoKey> mPrivateKey;
  OwningNonNull<mozilla::dom::CryptoKey> mPublicKey;

  CryptoKeyPair();

  explicit inline CryptoKeyPair(const CryptoKeyPair& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline CryptoKeyPair(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, CryptoKeyPairAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const CryptoKeyPair& aOther);
};

namespace binding_detail {
struct FastCryptoKeyPair : public CryptoKeyPair
{
  inline FastCryptoKeyPair()
    : CryptoKeyPair(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct RsaHashedImportParams : public DictionaryBase
{
  OwningObjectOrString mHash;

  RsaHashedImportParams();

protected:
  explicit inline RsaHashedImportParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  RsaHashedImportParams(const RsaHashedImportParams&) MOZ_DELETE;
  void operator=(const RsaHashedImportParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, RsaHashedImportParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastRsaHashedImportParams : public RsaHashedImportParams
{
  inline FastRsaHashedImportParams()
    : RsaHashedImportParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct RsaOtherPrimesInfo : public DictionaryBase
{
  nsString mD;
  nsString mR;
  nsString mT;

  RsaOtherPrimesInfo();

  explicit inline RsaOtherPrimesInfo(const RsaOtherPrimesInfo& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline RsaOtherPrimesInfo(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, RsaOtherPrimesInfoAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const RsaOtherPrimesInfo& aOther);
};

namespace binding_detail {
struct FastRsaOtherPrimesInfo : public RsaOtherPrimesInfo
{
  inline FastRsaOtherPrimesInfo()
    : RsaOtherPrimesInfo(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct AesCbcParams : public Algorithm
{
  OwningArrayBufferViewOrArrayBuffer mIv;

  AesCbcParams();

protected:
  explicit inline AesCbcParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  AesCbcParams(const AesCbcParams&) MOZ_DELETE;
  void operator=(const AesCbcParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, AesCbcParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastAesCbcParams : public AesCbcParams
{
  inline FastAesCbcParams()
    : AesCbcParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct AesCtrParams : public Algorithm
{
  OwningArrayBufferViewOrArrayBuffer mCounter;
  uint8_t mLength;

  AesCtrParams();

protected:
  explicit inline AesCtrParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  AesCtrParams(const AesCtrParams&) MOZ_DELETE;
  void operator=(const AesCtrParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, AesCtrParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastAesCtrParams : public AesCtrParams
{
  inline FastAesCtrParams()
    : AesCtrParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct AesDerivedKeyParams : public Algorithm
{
  uint32_t mLength;

  AesDerivedKeyParams();

  explicit inline AesDerivedKeyParams(const AesDerivedKeyParams& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline AesDerivedKeyParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, AesDerivedKeyParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const AesDerivedKeyParams& aOther);
};

namespace binding_detail {
struct FastAesDerivedKeyParams : public AesDerivedKeyParams
{
  inline FastAesDerivedKeyParams()
    : AesDerivedKeyParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct AesGcmParams : public Algorithm
{
  Optional<OwningArrayBufferViewOrArrayBuffer> mAdditionalData;
  OwningArrayBufferViewOrArrayBuffer mIv;
  Optional<uint8_t> mTagLength;

  AesGcmParams();

protected:
  explicit inline AesGcmParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  AesGcmParams(const AesGcmParams&) MOZ_DELETE;
  void operator=(const AesGcmParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, AesGcmParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastAesGcmParams : public AesGcmParams
{
  inline FastAesGcmParams()
    : AesGcmParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct AesKeyGenParams : public Algorithm
{
  uint16_t mLength;

  AesKeyGenParams();

  explicit inline AesKeyGenParams(const AesKeyGenParams& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline AesKeyGenParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, AesKeyGenParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const AesKeyGenParams& aOther);
};

namespace binding_detail {
struct FastAesKeyGenParams : public AesKeyGenParams
{
  inline FastAesKeyGenParams()
    : AesKeyGenParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct DhImportKeyParams : public Algorithm
{
  Uint8Array mGenerator;
  Uint8Array mPrime;

  DhImportKeyParams();

protected:
  explicit inline DhImportKeyParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  DhImportKeyParams(const DhImportKeyParams&) MOZ_DELETE;
  void operator=(const DhImportKeyParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, DhImportKeyParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastDhImportKeyParams : public DhImportKeyParams
{
  inline FastDhImportKeyParams()
    : DhImportKeyParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct DhKeyDeriveParams : public Algorithm
{
  OwningNonNull<mozilla::dom::CryptoKey> mPublic;

  DhKeyDeriveParams();

  explicit inline DhKeyDeriveParams(const DhKeyDeriveParams& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline DhKeyDeriveParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, DhKeyDeriveParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const DhKeyDeriveParams& aOther);
};

namespace binding_detail {
struct FastDhKeyDeriveParams : public DhKeyDeriveParams
{
  inline FastDhKeyDeriveParams()
    : DhKeyDeriveParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct DhKeyGenParams : public Algorithm
{
  Uint8Array mGenerator;
  Uint8Array mPrime;

  DhKeyGenParams();

protected:
  explicit inline DhKeyGenParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  DhKeyGenParams(const DhKeyGenParams&) MOZ_DELETE;
  void operator=(const DhKeyGenParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, DhKeyGenParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastDhKeyGenParams : public DhKeyGenParams
{
  inline FastDhKeyGenParams()
    : DhKeyGenParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct EcKeyGenParams : public Algorithm
{
  nsString mNamedCurve;

  EcKeyGenParams();

  explicit inline EcKeyGenParams(const EcKeyGenParams& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline EcKeyGenParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, EcKeyGenParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const EcKeyGenParams& aOther);
};

namespace binding_detail {
struct FastEcKeyGenParams : public EcKeyGenParams
{
  inline FastEcKeyGenParams()
    : EcKeyGenParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct EcdhKeyDeriveParams : public Algorithm
{
  OwningNonNull<mozilla::dom::CryptoKey> mPublic;

  EcdhKeyDeriveParams();

  explicit inline EcdhKeyDeriveParams(const EcdhKeyDeriveParams& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline EcdhKeyDeriveParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, EcdhKeyDeriveParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const EcdhKeyDeriveParams& aOther);
};

namespace binding_detail {
struct FastEcdhKeyDeriveParams : public EcdhKeyDeriveParams
{
  inline FastEcdhKeyDeriveParams()
    : EcdhKeyDeriveParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct EcdsaParams : public Algorithm
{
  OwningObjectOrString mHash;

  EcdsaParams();

protected:
  explicit inline EcdsaParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  EcdsaParams(const EcdsaParams&) MOZ_DELETE;
  void operator=(const EcdsaParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, EcdsaParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastEcdsaParams : public EcdsaParams
{
  inline FastEcdsaParams()
    : EcdsaParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct HmacImportParams : public Algorithm
{
  OwningObjectOrString mHash;

  HmacImportParams();

protected:
  explicit inline HmacImportParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  HmacImportParams(const HmacImportParams&) MOZ_DELETE;
  void operator=(const HmacImportParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, HmacImportParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastHmacImportParams : public HmacImportParams
{
  inline FastHmacImportParams()
    : HmacImportParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct HmacKeyGenParams : public Algorithm
{
  OwningObjectOrString mHash;
  Optional<uint32_t> mLength;

  HmacKeyGenParams();

protected:
  explicit inline HmacKeyGenParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  HmacKeyGenParams(const HmacKeyGenParams&) MOZ_DELETE;
  void operator=(const HmacKeyGenParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, HmacKeyGenParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastHmacKeyGenParams : public HmacKeyGenParams
{
  inline FastHmacKeyGenParams()
    : HmacKeyGenParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct JsonWebKey : public DictionaryBase
{
  Optional<nsString> mAlg;
  Optional<nsString> mCrv;
  Optional<nsString> mD;
  Optional<nsString> mDp;
  Optional<nsString> mDq;
  Optional<nsString> mE;
  Optional<bool> mExt;
  Optional<nsString> mK;
  Optional<Sequence<nsString>> mKey_ops;
  nsString mKty;
  Optional<nsString> mN;
  Optional<Sequence<RsaOtherPrimesInfo>> mOth;
  Optional<nsString> mP;
  Optional<nsString> mQ;
  Optional<nsString> mQi;
  Optional<nsString> mUse;
  Optional<nsString> mX;
  Optional<nsString> mY;

  JsonWebKey();

  explicit inline JsonWebKey(const JsonWebKey& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline JsonWebKey(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, JsonWebKeyAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const JsonWebKey& aOther);
};

namespace binding_detail {
struct FastJsonWebKey : public JsonWebKey
{
  inline FastJsonWebKey()
    : JsonWebKey(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct Pbkdf2Params : public Algorithm
{
  OwningObjectOrString mHash;
  uint32_t mIterations;
  OwningArrayBufferViewOrArrayBuffer mSalt;

  Pbkdf2Params();

protected:
  explicit inline Pbkdf2Params(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  Pbkdf2Params(const Pbkdf2Params&) MOZ_DELETE;
  void operator=(const Pbkdf2Params) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, Pbkdf2ParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastPbkdf2Params : public Pbkdf2Params
{
  inline FastPbkdf2Params()
    : Pbkdf2Params(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct RsaHashedKeyGenParams : public Algorithm
{
  OwningObjectOrString mHash;
  uint32_t mModulusLength;
  Uint8Array mPublicExponent;

  RsaHashedKeyGenParams();

protected:
  explicit inline RsaHashedKeyGenParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  RsaHashedKeyGenParams(const RsaHashedKeyGenParams&) MOZ_DELETE;
  void operator=(const RsaHashedKeyGenParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, RsaHashedKeyGenParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastRsaHashedKeyGenParams : public RsaHashedKeyGenParams
{
  inline FastRsaHashedKeyGenParams()
    : RsaHashedKeyGenParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct RsaOaepParams : public Algorithm
{
  Optional<OwningArrayBufferViewOrArrayBuffer> mLabel;

  RsaOaepParams();

protected:
  explicit inline RsaOaepParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  RsaOaepParams(const RsaOaepParams&) MOZ_DELETE;
  void operator=(const RsaOaepParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, RsaOaepParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastRsaOaepParams : public RsaOaepParams
{
  inline FastRsaOaepParams()
    : RsaOaepParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct HmacDerivedKeyParams : public HmacImportParams
{
  Optional<uint32_t> mLength;

  HmacDerivedKeyParams();

protected:
  explicit inline HmacDerivedKeyParams(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  HmacDerivedKeyParams(const HmacDerivedKeyParams&) MOZ_DELETE;
  void operator=(const HmacDerivedKeyParams) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, HmacDerivedKeyParamsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastHmacDerivedKeyParams : public HmacDerivedKeyParams
{
  inline FastHmacDerivedKeyParams()
    : HmacDerivedKeyParams(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


namespace CryptoKeyBinding {

  typedef mozilla::dom::CryptoKey NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  JSObject*
  DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);

  bool
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);

  const JSClass*
  GetJSClass();

  JSObject*
  Wrap(JSContext* aCx, mozilla::dom::CryptoKey* aObject, nsWrapperCache* aCache);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject)
  {
    return Wrap(aCx, aObject, aObject);
  }

  void
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);

  JS::Handle<JSObject*>
  GetProtoObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

  JS::Handle<JSObject*>
  GetConstructorObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal, bool aDefineOnGlobal = true);

  JSObject*
  GetConstructorObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

} // namespace CryptoKeyBinding



namespace SubtleCryptoBinding {

  typedef mozilla::dom::SubtleCrypto NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  JSObject*
  DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);

  bool
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);

  const JSClass*
  GetJSClass();

  JSObject*
  Wrap(JSContext* aCx, mozilla::dom::SubtleCrypto* aObject, nsWrapperCache* aCache);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject)
  {
    return Wrap(aCx, aObject, aObject);
  }

  void
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);

  JS::Handle<JSObject*>
  GetProtoObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

  JS::Handle<JSObject*>
  GetConstructorObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal, bool aDefineOnGlobal = true);

  JSObject*
  GetConstructorObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

} // namespace SubtleCryptoBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_SubtleCryptoBinding_h
