mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
440 lines
12 KiB
Smali
440 lines
12 KiB
Smali
.class public final Lokio/HashingSink;
|
|
.super Lokio/ForwardingSink;
|
|
.source "HashingSink.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lokio/HashingSink$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/SourceDebugExtension;
|
|
value = "SMAP\nHashingSink.kt\nKotlin\n*S Kotlin\n*F\n+ 1 HashingSink.kt\nokio/HashingSink\n+ 2 -Util.kt\nokio/-Util\n*L\n1#1,125:1\n75#2:126\n*E\n*S KotlinDebug\n*F\n+ 1 HashingSink.kt\nokio/HashingSink\n*L\n68#1:126\n*E\n"
|
|
.end annotation
|
|
|
|
.annotation runtime Lkotlin/Metadata;
|
|
bv = {
|
|
0x1,
|
|
0x0,
|
|
0x3
|
|
}
|
|
d1 = {
|
|
"\u0000B\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\u0008\u0002\u0018\u0000 \u00172\u00020\u0001:\u0001\u0017B\u0017\u0008\u0010\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u00a2\u0006\u0002\u0010\u0006B\u001f\u0008\u0010\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0007\u001a\u00020\u0008\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u00a2\u0006\u0002\u0010\tJ\r\u0010\n\u001a\u00020\u0008H\u0007\u00a2\u0006\u0002\u0008\u0010J\u0018\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0016H\u0016R\u0011\u0010\n\u001a\u00020\u00088G\u00a2\u0006\u0006\u001a\u0004\u0008\n\u0010\u000bR\u0010\u0010\u000c\u001a\u0004\u0018\u00010\rX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u000e\u001a\u0004\u0018\u00010\u000fX\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0018"
|
|
}
|
|
d2 = {
|
|
"Lokio/HashingSink;",
|
|
"Lokio/ForwardingSink;",
|
|
"sink",
|
|
"Lokio/Sink;",
|
|
"algorithm",
|
|
"",
|
|
"(Lokio/Sink;Ljava/lang/String;)V",
|
|
"key",
|
|
"Lokio/ByteString;",
|
|
"(Lokio/Sink;Lokio/ByteString;Ljava/lang/String;)V",
|
|
"hash",
|
|
"()Lokio/ByteString;",
|
|
"mac",
|
|
"Ljavax/crypto/Mac;",
|
|
"messageDigest",
|
|
"Ljava/security/MessageDigest;",
|
|
"-deprecated_hash",
|
|
"write",
|
|
"",
|
|
"source",
|
|
"Lokio/Buffer;",
|
|
"byteCount",
|
|
"",
|
|
"Companion",
|
|
"okio"
|
|
}
|
|
k = 0x1
|
|
mv = {
|
|
0x1,
|
|
0x4,
|
|
0x0
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lokio/HashingSink$Companion;
|
|
|
|
|
|
# instance fields
|
|
.field private final mac:Ljavax/crypto/Mac;
|
|
|
|
.field private final messageDigest:Ljava/security/MessageDigest;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
new-instance v0, Lokio/HashingSink$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lokio/HashingSink$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lokio/Sink;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
const-string v0, "sink"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "algorithm"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 44
|
|
invoke-direct {p0, p1}, Lokio/ForwardingSink;-><init>(Lokio/Sink;)V
|
|
|
|
.line 45
|
|
invoke-static {p2}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lokio/HashingSink;->messageDigest:Ljava/security/MessageDigest;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 46
|
|
move-object p2, p1
|
|
|
|
check-cast p2, Ljavax/crypto/Mac;
|
|
|
|
iput-object p1, p0, Lokio/HashingSink;->mac:Ljavax/crypto/Mac;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lokio/Sink;Lokio/ByteString;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
const-string v0, "sink"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "key"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "algorithm"
|
|
|
|
invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 49
|
|
invoke-direct {p0, p1}, Lokio/ForwardingSink;-><init>(Lokio/Sink;)V
|
|
|
|
.line 51
|
|
:try_start_0
|
|
invoke-static {p3}, Ljavax/crypto/Mac;->getInstance(Ljava/lang/String;)Ljavax/crypto/Mac;
|
|
|
|
move-result-object p1
|
|
|
|
.line 52
|
|
new-instance v0, Ljavax/crypto/spec/SecretKeySpec;
|
|
|
|
invoke-virtual {p2}, Lokio/ByteString;->toByteArray()[B
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {v0, p2, p3}, Ljavax/crypto/spec/SecretKeySpec;-><init>([BLjava/lang/String;)V
|
|
|
|
check-cast v0, Ljava/security/Key;
|
|
|
|
invoke-virtual {p1, v0}, Ljavax/crypto/Mac;->init(Ljava/security/Key;)V
|
|
|
|
.line 53
|
|
sget-object p2, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
|
|
|
|
iput-object p1, p0, Lokio/HashingSink;->mac:Ljavax/crypto/Mac;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 54
|
|
move-object p2, p1
|
|
|
|
check-cast p2, Ljava/security/MessageDigest;
|
|
|
|
iput-object p1, p0, Lokio/HashingSink;->messageDigest:Ljava/security/MessageDigest;
|
|
:try_end_0
|
|
.catch Ljava/security/InvalidKeyException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 56
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
check-cast p0, Ljava/lang/Throwable;
|
|
|
|
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
check-cast p1, Ljava/lang/Throwable;
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static final hmacSha1(Lokio/Sink;Lokio/ByteString;)Lokio/HashingSink;
|
|
.locals 1
|
|
.annotation runtime Lkotlin/jvm/JvmStatic;
|
|
.end annotation
|
|
|
|
sget-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
invoke-virtual {v0, p0, p1}, Lokio/HashingSink$Companion;->hmacSha1(Lokio/Sink;Lokio/ByteString;)Lokio/HashingSink;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final hmacSha256(Lokio/Sink;Lokio/ByteString;)Lokio/HashingSink;
|
|
.locals 1
|
|
.annotation runtime Lkotlin/jvm/JvmStatic;
|
|
.end annotation
|
|
|
|
sget-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
invoke-virtual {v0, p0, p1}, Lokio/HashingSink$Companion;->hmacSha256(Lokio/Sink;Lokio/ByteString;)Lokio/HashingSink;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final hmacSha512(Lokio/Sink;Lokio/ByteString;)Lokio/HashingSink;
|
|
.locals 1
|
|
.annotation runtime Lkotlin/jvm/JvmStatic;
|
|
.end annotation
|
|
|
|
sget-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
invoke-virtual {v0, p0, p1}, Lokio/HashingSink$Companion;->hmacSha512(Lokio/Sink;Lokio/ByteString;)Lokio/HashingSink;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final md5(Lokio/Sink;)Lokio/HashingSink;
|
|
.locals 1
|
|
.annotation runtime Lkotlin/jvm/JvmStatic;
|
|
.end annotation
|
|
|
|
sget-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
invoke-virtual {v0, p0}, Lokio/HashingSink$Companion;->md5(Lokio/Sink;)Lokio/HashingSink;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final sha1(Lokio/Sink;)Lokio/HashingSink;
|
|
.locals 1
|
|
.annotation runtime Lkotlin/jvm/JvmStatic;
|
|
.end annotation
|
|
|
|
sget-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
invoke-virtual {v0, p0}, Lokio/HashingSink$Companion;->sha1(Lokio/Sink;)Lokio/HashingSink;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final sha256(Lokio/Sink;)Lokio/HashingSink;
|
|
.locals 1
|
|
.annotation runtime Lkotlin/jvm/JvmStatic;
|
|
.end annotation
|
|
|
|
sget-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
invoke-virtual {v0, p0}, Lokio/HashingSink$Companion;->sha256(Lokio/Sink;)Lokio/HashingSink;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final sha512(Lokio/Sink;)Lokio/HashingSink;
|
|
.locals 1
|
|
.annotation runtime Lkotlin/jvm/JvmStatic;
|
|
.end annotation
|
|
|
|
sget-object v0, Lokio/HashingSink;->Companion:Lokio/HashingSink$Companion;
|
|
|
|
invoke-virtual {v0, p0}, Lokio/HashingSink$Companion;->sha512(Lokio/Sink;)Lokio/HashingSink;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final -deprecated_hash()Lokio/ByteString;
|
|
.locals 0
|
|
.annotation runtime Lkotlin/Deprecated;
|
|
level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel;
|
|
message = "moved to val"
|
|
replaceWith = .subannotation Lkotlin/ReplaceWith;
|
|
expression = "hash"
|
|
imports = {}
|
|
.end subannotation
|
|
.end annotation
|
|
|
|
.line 100
|
|
invoke-virtual {p0}, Lokio/HashingSink;->hash()Lokio/ByteString;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public final hash()Lokio/ByteString;
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lokio/HashingSink;->messageDigest:Ljava/security/MessageDigest;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 91
|
|
invoke-virtual {v0}, Ljava/security/MessageDigest;->digest()[B
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p0, p0, Lokio/HashingSink;->mac:Ljavax/crypto/Mac;
|
|
|
|
invoke-static {p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {p0}, Ljavax/crypto/Mac;->doFinal()[B
|
|
|
|
move-result-object p0
|
|
|
|
.line 92
|
|
:goto_0
|
|
new-instance v0, Lokio/ByteString;
|
|
|
|
const-string v1, "result"
|
|
|
|
invoke-static {p0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {v0, p0}, Lokio/ByteString;-><init>([B)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public write(Lokio/Buffer;J)V
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "source"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 62
|
|
invoke-virtual {p1}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v1
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
move-wide v5, p2
|
|
|
|
invoke-static/range {v1 .. v6}, Lokio/-Util;->checkOffsetAndCount(JJJ)V
|
|
|
|
.line 66
|
|
iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
|
|
|
|
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
:goto_0
|
|
cmp-long v3, v1, p2
|
|
|
|
if-gez v3, :cond_1
|
|
|
|
sub-long v3, p2, v1
|
|
|
|
.line 68
|
|
iget v5, v0, Lokio/Segment;->limit:I
|
|
|
|
iget v6, v0, Lokio/Segment;->pos:I
|
|
|
|
sub-int/2addr v5, v6
|
|
|
|
int-to-long v5, v5
|
|
|
|
.line 126
|
|
invoke-static {v3, v4, v5, v6}, Ljava/lang/Math;->min(JJ)J
|
|
|
|
move-result-wide v3
|
|
|
|
long-to-int v3, v3
|
|
|
|
iget-object v4, p0, Lokio/HashingSink;->messageDigest:Ljava/security/MessageDigest;
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
.line 70
|
|
iget-object v5, v0, Lokio/Segment;->data:[B
|
|
|
|
iget v6, v0, Lokio/Segment;->pos:I
|
|
|
|
invoke-virtual {v4, v5, v6, v3}, Ljava/security/MessageDigest;->update([BII)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iget-object v4, p0, Lokio/HashingSink;->mac:Ljavax/crypto/Mac;
|
|
|
|
.line 72
|
|
invoke-static {v4}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget-object v5, v0, Lokio/Segment;->data:[B
|
|
|
|
iget v6, v0, Lokio/Segment;->pos:I
|
|
|
|
invoke-virtual {v4, v5, v6, v3}, Ljavax/crypto/Mac;->update([BII)V
|
|
|
|
:goto_1
|
|
int-to-long v3, v3
|
|
|
|
add-long/2addr v1, v3
|
|
|
|
.line 75
|
|
iget-object v0, v0, Lokio/Segment;->next:Lokio/Segment;
|
|
|
|
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 79
|
|
:cond_1
|
|
invoke-super {p0, p1, p2, p3}, Lokio/ForwardingSink;->write(Lokio/Buffer;J)V
|
|
|
|
return-void
|
|
.end method
|