All Downloads are FREE. Search and download functionalities are using the official Maven repository.

s.fisco-bcos-tars-sdk.3.5.0.source-code.SymmetricEncryption Maven / Gradle / Ivy

The newest version!
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.1
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.fisco.bcos.sdk.tars;

public class SymmetricEncryption {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected SymmetricEncryption(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(SymmetricEncryption obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(SymmetricEncryption obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        bcosJNI.delete_SymmetricEncryption(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public SWIGTYPE_p_bytesPointer symmetricEncrypt(SWIGTYPE_p_unsigned_char _plainData, long _plainDataSize, SWIGTYPE_p_unsigned_char _key, long _keySize) {
    return new SWIGTYPE_p_bytesPointer(bcosJNI.SymmetricEncryption_symmetricEncrypt__SWIG_0(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(_plainData), _plainDataSize, SWIGTYPE_p_unsigned_char.getCPtr(_key), _keySize), true);
  }

  public SWIGTYPE_p_bytesPointer symmetricDecrypt(SWIGTYPE_p_unsigned_char _cipherData, long _cipherDataSize, SWIGTYPE_p_unsigned_char _key, long _keySize) {
    return new SWIGTYPE_p_bytesPointer(bcosJNI.SymmetricEncryption_symmetricDecrypt__SWIG_0(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(_cipherData), _cipherDataSize, SWIGTYPE_p_unsigned_char.getCPtr(_key), _keySize), true);
  }

  public SWIGTYPE_p_bytesPointer symmetricEncrypt(SWIGTYPE_p_unsigned_char _plainData, long _plainDataSize, SWIGTYPE_p_unsigned_char _key, long _keySize, SWIGTYPE_p_unsigned_char _ivData, long _ivDataSize) {
    return new SWIGTYPE_p_bytesPointer(bcosJNI.SymmetricEncryption_symmetricEncrypt__SWIG_1(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(_plainData), _plainDataSize, SWIGTYPE_p_unsigned_char.getCPtr(_key), _keySize, SWIGTYPE_p_unsigned_char.getCPtr(_ivData), _ivDataSize), true);
  }

  public SWIGTYPE_p_bytesPointer symmetricDecrypt(SWIGTYPE_p_unsigned_char _cipherData, long _cipherDataSize, SWIGTYPE_p_unsigned_char _key, long _keySize, SWIGTYPE_p_unsigned_char _ivData, long _ivDataSize) {
    return new SWIGTYPE_p_bytesPointer(bcosJNI.SymmetricEncryption_symmetricDecrypt__SWIG_1(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(_cipherData), _cipherDataSize, SWIGTYPE_p_unsigned_char.getCPtr(_key), _keySize, SWIGTYPE_p_unsigned_char.getCPtr(_ivData), _ivDataSize), true);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy