Class EncryptedHashedArguments

java.lang.Object
net.finmath.decryptionoracle.decryption.arguments.EncryptedHashedArguments

public class EncryptedHashedArguments extends Object
Java representation of the Solidity struct EncryptedHashedArguments: struct EncryptedHashedArguments { bytes32 argsHash; bytes32 publicKeyId; bytes ciphertext; } This class does not perform encryption itself; you pass in the ciphertext. It does provide a helper for computing argsHash from ABI-encoded plaintext arguments.
Author:
Christian Fries
  • Constructor Details

    • EncryptedHashedArguments

      public EncryptedHashedArguments(byte[] argsHash, byte[] publicKeyId, byte[] ciphertext)

      Constructor for EncryptedHashedArguments.

      Parameters:
      argsHash - an array of bytes objects
      publicKeyId - an array of bytes objects
      ciphertext - an array of bytes objects
  • Method Details

    • computeArgsHash

      public static byte[] computeArgsHash(byte[] abiEncodedArguments)
      Compute argsHash = keccak256(abiEncodedArguments). In most cases abiEncodedArguments will be produced with web3j ABI encoding or your own encoder.
      Parameters:
      abiEncodedArguments - an array of bytes objects
      Returns:
      an array of bytes objects
    • of

      public static EncryptedHashedArguments of(byte[] abiEncodedArguments, byte[] publicKeyId, byte[] ciphertext)
      Convenience factory: compute argsHash from plaintext ABI-encoded arguments.
      Parameters:
      abiEncodedArguments - ABI-encoded tuple of argumentsWithoutHash
      publicKeyId - identifier of the public key (32 bytes)
      ciphertext - encrypted abiEncodedArguments
      Returns:
      a EncryptedHashedArguments object
    • getArgsHash

      public byte[] getArgsHash()

      Getter for the field argsHash.

      Returns:
      an array of bytes objects
    • getPublicKeyId

      public byte[] getPublicKeyId()

      Getter for the field publicKeyId.

      Returns:
      an array of bytes objects
    • getCiphertext

      public byte[] getCiphertext()

      Getter for the field ciphertext.

      Returns:
      an array of bytes objects
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object