///
/// HybridCipherSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `CipherArgs` to properly resolve imports.
namespace margelo::nitro::crypto { struct CipherArgs; }
// Forward declaration of `CipherInfo` to properly resolve imports.
namespace margelo::nitro::crypto { struct CipherInfo; }

#include <NitroModules/ArrayBuffer.hpp>
#include "CipherArgs.hpp"
#include <optional>
#include <string>
#include <vector>
#include "CipherInfo.hpp"

namespace margelo::nitro::crypto {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `Cipher`
   * Inherit this class to create instances of `HybridCipherSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridCipher: public HybridCipherSpec {
   * public:
   *   HybridCipher(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridCipherSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridCipherSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridCipherSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::shared_ptr<ArrayBuffer> update(const std::shared_ptr<ArrayBuffer>& data) = 0;
      virtual std::shared_ptr<ArrayBuffer> final() = 0;
      virtual void setArgs(const CipherArgs& args) = 0;
      virtual bool setAAD(const std::shared_ptr<ArrayBuffer>& data, std::optional<double> plaintextLength) = 0;
      virtual bool setAutoPadding(bool autoPad) = 0;
      virtual bool setAuthTag(const std::shared_ptr<ArrayBuffer>& tag) = 0;
      virtual std::shared_ptr<ArrayBuffer> getAuthTag() = 0;
      virtual std::vector<std::string> getSupportedCiphers() = 0;
      virtual std::optional<CipherInfo> getCipherInfo(const std::string& name, std::optional<double> keyLength, std::optional<double> ivLength) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "Cipher";
  };

} // namespace margelo::nitro::crypto
