class com.codahale.metrics.collectd.PacketWriter extends java.lang.Object
{
private static final int TYPE_HOST;
private static final int TYPE_TIME;
private static final int TYPE_PLUGIN;
private static final int TYPE_PLUGIN_INSTANCE;
private static final int TYPE_TYPE;
private static final int TYPE_TYPE_INSTANCE;
private static final int TYPE_VALUES;
private static final int TYPE_INTERVAL;
private static final int TYPE_SIGN_SHA256;
private static final int TYPE_ENCR_AES256;
private static final int UINT16_LEN;
private static final int UINT32_LEN;
private static final int UINT64_LEN;
private static final int HEADER_LEN;
private static final int BUFFER_SIZE;
private static final int VALUE_COUNT_LEN;
private static final int NUMBER_LEN;
private static final int SIGNATURE_LEN;
private static final int ENCRYPT_DATA_LEN;
private static final int IV_LENGTH;
private static final int SHA1_LENGTH;
private static final int VALUE_LEN;
private static final byte DATA_TYPE_GAUGE;
private static final byte NULL;
private static final java.lang.String HMAC_SHA256_ALGORITHM;
private static final java.lang.String AES_CYPHER;
private static final java.lang.String AES;
private static final java.lang.String SHA_256_ALGORITHM;
private static final java.lang.String SHA_1_ALGORITHM;
private final com.codahale.metrics.collectd.Sender sender;
private final com.codahale.metrics.collectd.SecurityLevel securityLevel;
private final byte[] username;
private final byte[] password;
void <init>(com.codahale.metrics.collectd.Sender, java.lang.String, java.lang.String, com.codahale.metrics.collectd.SecurityLevel)
{
byte[] v, v;
com.codahale.metrics.collectd.Sender v;
com.codahale.metrics.collectd.SecurityLevel v;
com.codahale.metrics.collectd.PacketWriter v;
java.nio.charset.Charset v, v;
java.lang.String v, v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: com.codahale.metrics.collectd.Sender;
v := @parameter: java.lang.String;
v := @parameter: java.lang.String;
v := @parameter: com.codahale.metrics.collectd.SecurityLevel;
specialinvoke v.<java.lang.Object: void <init>()>();
v.<com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.Sender sender> = v;
v.<com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.SecurityLevel securityLevel> = v;
if v == null goto label;
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
v = virtualinvoke v.<java.lang.String: byte[] getBytes(java.nio.charset.Charset)>(v);
goto label;
label:
v = null;
label:
v.<com.codahale.metrics.collectd.PacketWriter: byte[] username> = v;
if v == null goto label;
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
v = virtualinvoke v.<java.lang.String: byte[] getBytes(java.nio.charset.Charset)>(v);
goto label;
label:
v = null;
label:
v.<com.codahale.metrics.collectd.PacketWriter: byte[] password> = v;
return;
}
transient void write(com.codahale.metrics.collectd.MetaData, java.lang.Number[]) throws java.nio.BufferOverflowException, java.io.IOException
{
com.codahale.metrics.collectd.Sender v, v, v;
com.codahale.metrics.collectd.SecurityLevel v, v;
java.nio.ByteBuffer v, v, v;
com.codahale.metrics.collectd.PacketWriter v;
int[] v;
int v, v;
java.lang.String v;
com.codahale.metrics.collectd.MetaData v;
java.lang.IllegalArgumentException v;
java.lang.Number[] v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: com.codahale.metrics.collectd.MetaData;
v := @parameter: java.lang.Number[];
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer allocate(int)>(1024);
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void write(java.nio.ByteBuffer,com.codahale.metrics.collectd.MetaData)>(v, v);
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void write(java.nio.ByteBuffer,java.lang.Number[])>(v, v);
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
v = <com.codahale.metrics.collectd.PacketWriter$1: int[] $SwitchMap$com$codahale$metrics$collectd$SecurityLevel>;
v = v.<com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.SecurityLevel securityLevel>;
v = virtualinvoke v.<com.codahale.metrics.collectd.SecurityLevel: int ordinal()>();
v = v[v];
tableswitch(v)
{
case 1: goto label;
case 2: goto label;
case 3: goto label;
default: goto label;
};
label:
v = v.<com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.Sender sender>;
virtualinvoke v.<com.codahale.metrics.collectd.Sender: void send(java.nio.ByteBuffer)>(v);
goto label;
label:
v = v.<com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.Sender sender>;
v = specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: java.nio.ByteBuffer signPacket(java.nio.ByteBuffer)>(v);
virtualinvoke v.<com.codahale.metrics.collectd.Sender: void send(java.nio.ByteBuffer)>(v);
goto label;
label:
v = v.<com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.Sender sender>;
v = specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: java.nio.ByteBuffer encryptPacket(java.nio.ByteBuffer)>(v);
virtualinvoke v.<com.codahale.metrics.collectd.Sender: void send(java.nio.ByteBuffer)>(v);
goto label;
label:
v = new java.lang.IllegalArgumentException;
v = v.<com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.SecurityLevel securityLevel>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (com.codahale.metrics.collectd.SecurityLevel)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Unsupported security level: \u0001");
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>(v);
throw v;
label:
return;
}
private void write(java.nio.ByteBuffer, com.codahale.metrics.collectd.MetaData)
{
long v, v;
java.nio.ByteBuffer v;
com.codahale.metrics.collectd.PacketWriter v;
java.lang.String v, v, v, v, v;
com.codahale.metrics.collectd.MetaData v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: java.nio.ByteBuffer;
v := @parameter: com.codahale.metrics.collectd.MetaData;
v = virtualinvoke v.<com.codahale.metrics.collectd.MetaData: java.lang.String getHost()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeString(java.nio.ByteBuffer,int,java.lang.String)>(v, 0, v);
v = virtualinvoke v.<com.codahale.metrics.collectd.MetaData: long getTimestamp()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeNumber(java.nio.ByteBuffer,int,long)>(v, 1, v);
v = virtualinvoke v.<com.codahale.metrics.collectd.MetaData: java.lang.String getPlugin()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeString(java.nio.ByteBuffer,int,java.lang.String)>(v, 2, v);
v = virtualinvoke v.<com.codahale.metrics.collectd.MetaData: java.lang.String getPluginInstance()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeString(java.nio.ByteBuffer,int,java.lang.String)>(v, 3, v);
v = virtualinvoke v.<com.codahale.metrics.collectd.MetaData: java.lang.String getType()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeString(java.nio.ByteBuffer,int,java.lang.String)>(v, 4, v);
v = virtualinvoke v.<com.codahale.metrics.collectd.MetaData: java.lang.String getTypeInstance()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeString(java.nio.ByteBuffer,int,java.lang.String)>(v, 5, v);
v = virtualinvoke v.<com.codahale.metrics.collectd.MetaData: long getPeriod()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeNumber(java.nio.ByteBuffer,int,long)>(v, 7, v);
return;
}
private transient void write(java.nio.ByteBuffer, java.lang.Number[])
{
byte[] v;
java.nio.ByteBuffer v;
java.lang.Number[] v;
java.nio.ByteOrder v, v;
com.codahale.metrics.collectd.PacketWriter v;
int v, v, v, v, v;
java.lang.Number v;
double v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: java.nio.ByteBuffer;
v := @parameter: java.lang.Number[];
v = lengthof v;
v = v * 9;
v = 6 + v;
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeHeader(java.nio.ByteBuffer,int,int)>(v, 6, v);
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(v);
v = specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: byte[] nCopies(int,byte)>(v, 1);
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
v = <java.nio.ByteOrder: java.nio.ByteOrder LITTLE_ENDIAN>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer order(java.nio.ByteOrder)>(v);
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = virtualinvoke v.<java.lang.Number: double doubleValue()>();
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putDouble(double)>(v);
v = v + 1;
goto label;
label:
v = <java.nio.ByteOrder: java.nio.ByteOrder BIG_ENDIAN>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer order(java.nio.ByteOrder)>(v);
return;
}
private byte[] nCopies(int, byte)
{
byte[] v;
com.codahale.metrics.collectd.PacketWriter v;
byte v;
int v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: int;
v := @parameter: byte;
v = newarray (byte)[v];
staticinvoke <java.util.Arrays: void fill(byte[],byte)>(v, v);
return v;
}
private void writeString(java.nio.ByteBuffer, int, java.lang.String)
{
byte[] v;
java.nio.ByteBuffer v, v;
com.codahale.metrics.collectd.PacketWriter v;
java.nio.charset.Charset v;
int v, v, v, v, v;
java.lang.String v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: java.nio.ByteBuffer;
v := @parameter: int;
v := @parameter: java.lang.String;
if v == null goto label;
v = virtualinvoke v.<java.lang.String: int length()>();
if v != 0 goto label;
label:
return;
label:
v = virtualinvoke v.<java.lang.String: int length()>();
v = 4 + v;
v = v + 1;
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeHeader(java.nio.ByteBuffer,int,int)>(v, v, v);
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset US_ASCII>;
v = virtualinvoke v.<java.lang.String: byte[] getBytes(java.nio.charset.Charset)>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte)>(0);
return;
}
private void writeNumber(java.nio.ByteBuffer, int, long)
{
com.codahale.metrics.collectd.PacketWriter v;
int v;
long v;
java.nio.ByteBuffer v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: java.nio.ByteBuffer;
v := @parameter: int;
v := @parameter: long;
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter: void writeHeader(java.nio.ByteBuffer,int,int)>(v, v, 12);
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putLong(long)>(v);
return;
}
private void writeHeader(java.nio.ByteBuffer, int, int)
{
com.codahale.metrics.collectd.PacketWriter v;
int v, v;
java.nio.ByteBuffer v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: java.nio.ByteBuffer;
v := @parameter: int;
v := @parameter: int;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(v);
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(v);
return;
}
private java.nio.ByteBuffer signPacket(java.nio.ByteBuffer)
{
byte[] v, v, v, v, v, v;
java.nio.ByteBuffer v, v, v, v, v, v, v, v, v, v, v, v, v;
com.codahale.metrics.collectd.PacketWriter v;
int v, v, v, v, v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: java.nio.ByteBuffer;
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] password>;
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] username>;
v = lengthof v;
v = v + v;
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer allocate(int)>(v);
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] username>;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(java.nio.ByteBuffer)>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
v = staticinvoke <com.codahale.metrics.collectd.PacketWriter: byte[] sign(byte[],java.nio.ByteBuffer)>(v, v);
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer allocate(int)>(1024);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(512);
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] username>;
v = lengthof v;
v = v + 36;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] username>;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(java.nio.ByteBuffer)>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
return v;
}
private java.nio.ByteBuffer encryptPacket(java.nio.ByteBuffer)
{
byte[] v, v, v, v, v, v;
java.nio.ByteBuffer v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
com.codahale.metrics.collectd.PacketWriter v;
int v, v, v, v, v, v, v;
com.codahale.metrics.collectd.PacketWriter$EncryptionResult v;
v := @this: com.codahale.metrics.collectd.PacketWriter;
v := @parameter: java.nio.ByteBuffer;
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
v = 20 + v;
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer allocate(int)>(v);
v = staticinvoke <com.codahale.metrics.collectd.PacketWriter: byte[] sha1(java.nio.ByteBuffer)>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(java.nio.ByteBuffer)>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] password>;
v = staticinvoke <com.codahale.metrics.collectd.PacketWriter: com.codahale.metrics.collectd.PacketWriter$EncryptionResult encrypt(byte[],java.nio.ByteBuffer)>(v, v);
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer allocate(int)>(1024);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(528);
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] username>;
v = lengthof v;
v = 22 + v;
v = v.<com.codahale.metrics.collectd.PacketWriter$EncryptionResult: java.nio.ByteBuffer output>;
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
v = v + v;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(v);
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] username>;
v = lengthof v;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer putShort(short)>(v);
v = v.<com.codahale.metrics.collectd.PacketWriter: byte[] username>;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
v = v.<com.codahale.metrics.collectd.PacketWriter$EncryptionResult: byte[] iv>;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(byte[])>(v);
v = v.<com.codahale.metrics.collectd.PacketWriter$EncryptionResult: java.nio.ByteBuffer output>;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer put(java.nio.ByteBuffer)>(v);
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
return v;
}
private static byte[] sign(byte[], java.nio.ByteBuffer)
{
byte[] v, v;
java.security.GeneralSecurityException v;
javax.crypto.Mac v;
javax.crypto.spec.SecretKeySpec v;
java.lang.RuntimeException v;
java.nio.ByteBuffer v;
v := @parameter: byte[];
v := @parameter: java.nio.ByteBuffer;
label:
v = staticinvoke <javax.crypto.Mac: javax.crypto.Mac getInstance(java.lang.String)>("HmacSHA256");
v = new javax.crypto.spec.SecretKeySpec;
specialinvoke v.<javax.crypto.spec.SecretKeySpec: void <init>(byte[],java.lang.String)>(v, "HmacSHA256");
virtualinvoke v.<javax.crypto.Mac: void init(java.security.Key)>(v);
label:
goto label;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
virtualinvoke v.<javax.crypto.Mac: void update(java.nio.ByteBuffer)>(v);
v = virtualinvoke v.<javax.crypto.Mac: byte[] doFinal()>();
return v;
catch java.security.NoSuchAlgorithmException from label to label with label;
catch java.security.InvalidKeyException from label to label with label;
}
private static com.codahale.metrics.collectd.PacketWriter$EncryptionResult encrypt(byte[], java.nio.ByteBuffer)
{
byte[] v, v, v;
java.lang.IllegalStateException v;
javax.crypto.spec.SecretKeySpec v;
javax.crypto.Cipher v;
java.nio.ByteBuffer v, v, v;
java.security.GeneralSecurityException v, v;
int v, v, v;
java.security.spec.InvalidParameterSpecException v;
java.security.spec.AlgorithmParameterSpec v;
java.lang.RuntimeException v, v, v;
java.security.AlgorithmParameters v;
com.codahale.metrics.collectd.PacketWriter$EncryptionResult v;
v := @parameter: byte[];
v := @parameter: java.nio.ByteBuffer;
label:
v = staticinvoke <javax.crypto.Cipher: javax.crypto.Cipher getInstance(java.lang.String)>("AES_256/OFB/NoPadding");
v = new javax.crypto.spec.SecretKeySpec;
v = staticinvoke <com.codahale.metrics.collectd.PacketWriter: byte[] sha256(byte[])>(v);
specialinvoke v.<javax.crypto.spec.SecretKeySpec: void <init>(byte[],java.lang.String)>(v, "AES");
virtualinvoke v.<javax.crypto.Cipher: void init(int,java.security.Key)>(1, v);
label:
goto label;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v = virtualinvoke v.<javax.crypto.Cipher: java.security.AlgorithmParameters getParameters()>();
v = virtualinvoke v.<java.security.AlgorithmParameters: java.security.spec.AlgorithmParameterSpec getParameterSpec(java.lang.Class)>(class "Ljavax/crypto/spec/IvParameterSpec;");
v = virtualinvoke v.<javax.crypto.spec.IvParameterSpec: byte[] getIV()>();
label:
goto label;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v = lengthof v;
if v == 16 goto label;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.String)>("Bad initialization vector");
throw v;
label:
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
v = v * 2;
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer allocate(int)>(v);
label:
virtualinvoke v.<javax.crypto.Cipher: int doFinal(java.nio.ByteBuffer,java.nio.ByteBuffer)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v = new com.codahale.metrics.collectd.PacketWriter$EncryptionResult;
v = virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
specialinvoke v.<com.codahale.metrics.collectd.PacketWriter$EncryptionResult: void <init>(byte[],java.nio.ByteBuffer)>(v, v);
return v;
catch java.security.NoSuchAlgorithmException from label to label with label;
catch javax.crypto.NoSuchPaddingException from label to label with label;
catch java.security.InvalidKeyException from label to label with label;
catch java.security.spec.InvalidParameterSpecException from label to label with label;
catch javax.crypto.ShortBufferException from label to label with label;
catch javax.crypto.IllegalBlockSizeException from label to label with label;
catch javax.crypto.BadPaddingException from label to label with label;
}
private static byte[] sha256(byte[])
{
byte[] v, v;
java.security.MessageDigest v;
java.security.NoSuchAlgorithmException v;
java.lang.RuntimeException v;
v := @parameter: byte[];
label:
v = staticinvoke <java.security.MessageDigest: java.security.MessageDigest getInstance(java.lang.String)>("SHA-256");
v = virtualinvoke v.<java.security.MessageDigest: byte[] digest(byte[])>(v);
label:
return v;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
catch java.security.NoSuchAlgorithmException from label to label with label;
}
private static byte[] sha1(java.nio.ByteBuffer)
{
byte[] v;
java.lang.IllegalStateException v;
java.security.MessageDigest v;
java.security.NoSuchAlgorithmException v;
int v;
java.lang.RuntimeException v;
java.nio.ByteBuffer v;
v := @parameter: java.nio.ByteBuffer;
label:
v = staticinvoke <java.security.MessageDigest: java.security.MessageDigest getInstance(java.lang.String)>("SHA1");
virtualinvoke v.<java.security.MessageDigest: void update(java.nio.ByteBuffer)>(v);
v = virtualinvoke v.<java.security.MessageDigest: byte[] digest()>();
v = lengthof v;
if v == 20 goto label;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.String)>("Bad SHA1 hash");
throw v;
label:
return v;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
catch java.security.NoSuchAlgorithmException from label to label with label;
}
}