Class EncryptedHashedArguments
java.lang.Object
net.finmath.decryptionoracle.decryption.arguments.EncryptedHashedArguments
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 Summary
ConstructorsConstructorDescriptionEncryptedHashedArguments(byte[] argsHash, byte[] publicKeyId, byte[] ciphertext) Constructor for EncryptedHashedArguments. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]computeArgsHash(byte[] abiEncodedArguments) Compute argsHash = keccak256(abiEncodedArguments).booleanbyte[]Getter for the fieldargsHash.byte[]Getter for the fieldciphertext.byte[]Getter for the fieldpublicKeyId.inthashCode()static EncryptedHashedArgumentsof(byte[] abiEncodedArguments, byte[] publicKeyId, byte[] ciphertext) Convenience factory: compute argsHash from plaintext ABI-encoded arguments.toString()
-
Constructor Details
-
EncryptedHashedArguments
public EncryptedHashedArguments(byte[] argsHash, byte[] publicKeyId, byte[] ciphertext) Constructor for EncryptedHashedArguments.
- Parameters:
argsHash- an array of bytes objectspublicKeyId- an array of bytes objectsciphertext- 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 argumentsWithoutHashpublicKeyId- identifier of the public key (32 bytes)ciphertext- encrypted abiEncodedArguments- Returns:
- a
EncryptedHashedArgumentsobject
-
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
-
equals
-
hashCode
public int hashCode()
-