CircomLib constructor

CircomLib()

Implementation

CircomLib() {
  _packSignature = lib
      .lookup<NativeFunction<Pointer<Utf8> Function(Pointer<Utf8>)>>(
          "pack_signature")
      .asFunction();

  _unpackSignature = lib
      .lookup<NativeFunction<Pointer<Utf8> Function(Pointer<Utf8>)>>(
          "unpack_signature")
      .asFunction();

  _packPoint = lib
      .lookup<
          NativeFunction<
              Pointer<Utf8> Function(
                  Pointer<Utf8>, Pointer<Utf8>)>>("pack_point")
      .asFunction();

  _unpackPoint = lib
      .lookup<NativeFunction<Pointer<Utf8> Function(Pointer<Utf8>)>>(
          "unpack_point")
      .asFunction();

  _prv2Pub = lib
      .lookup<NativeFunction<Pointer<Utf8> Function(Pointer<Utf8>)>>(
          "prv2pub")
      .asFunction();

  _hashPoseidon = lib
      .lookup<
          NativeFunction<
              Pointer<Utf8> Function(
                  Pointer<Utf8>,
                  Pointer<Utf8>,
                  Pointer<Utf8>,
                  Pointer<Utf8>,
                  Pointer<Utf8>,
                  Pointer<Utf8>)>>("hash_poseidon")
      .asFunction();

  _signPoseidon = lib
      .lookup<
          NativeFunction<
              Pointer<Utf8> Function(
                  Pointer<Utf8>, Pointer<Utf8>)>>("sign_poseidon")
      .asFunction();

  _verifyPoseidon = lib
      .lookup<
          NativeFunction<
              Pointer<Utf8> Function(Pointer<Utf8>, Pointer<Utf8>,
                  Pointer<Utf8>)>>("verify_poseidon")
      .asFunction();

  cstringFree =
      lib.lookup<NativeFunction<CStringFreeFFI>>("cstring_free").asFunction();
}