Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SHA3 implementation #7

Merged
merged 3 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions korlibs-crypto/api/android/korlibs-crypto.api
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,45 @@ public final class korlibs/crypto/SHA256Kt {
public static final fun sha256 ([B)Lkorlibs/crypto/Hash;
}

public class korlibs/crypto/SHA3 : korlibs/crypto/Hasher {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it final

public static final field Companion Lkorlibs/crypto/SHA3$Companion;
public static final field KECCAKF_ROUNDS I
public static final field SHA3_KECCAK_SPONGE_WORDS I
Comment on lines +255 to +256
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

protected fun coreDigest ([B)V
protected fun corePadding (J)[B
protected fun coreReset ()V
protected fun coreUpdate ([B)V
}

public final class korlibs/crypto/SHA3$Companion : korlibs/crypto/HasherFactory {
public final fun getKECCAKF_PI_LANE ()[I
public final fun getKECCAKF_ROTATION_OFFSETS ()[I
public final fun getKECCAKF_ROUND_CONSTANTS-Y2RjT0g ()[J
Comment on lines +264 to +266
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

}

public final class korlibs/crypto/SHA3Kt {
public static final fun sha3_224 ([B)Lkorlibs/crypto/Hash;
public static final fun sha3_256 ([B)Lkorlibs/crypto/Hash;
public static final fun sha3_384 ([B)Lkorlibs/crypto/Hash;
public static final fun sha3_512 ([B)Lkorlibs/crypto/Hash;
}

public final class korlibs/crypto/SHA3_224 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_224;
}

public final class korlibs/crypto/SHA3_256 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_256;
}

public final class korlibs/crypto/SHA3_384 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_384;
}

public final class korlibs/crypto/SHA3_512 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_512;
}

public final class korlibs/crypto/SHA512 : korlibs/crypto/SHA {
public static final field Companion Lkorlibs/crypto/SHA512$Companion;
public fun <init> ()V
Expand Down
39 changes: 39 additions & 0 deletions korlibs-crypto/api/jvm/korlibs-crypto.api
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,45 @@ public final class korlibs/crypto/SHA256Kt {
public static final fun sha256 ([B)Lkorlibs/crypto/Hash;
}

public class korlibs/crypto/SHA3 : korlibs/crypto/Hasher {
public static final field Companion Lkorlibs/crypto/SHA3$Companion;
public static final field KECCAKF_ROUNDS I
public static final field SHA3_KECCAK_SPONGE_WORDS I
Comment on lines +250 to +251
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

protected fun coreDigest ([B)V
protected fun corePadding (J)[B
protected fun coreReset ()V
protected fun coreUpdate ([B)V
}

public final class korlibs/crypto/SHA3$Companion : korlibs/crypto/HasherFactory {
public final fun getKECCAKF_PI_LANE ()[I
public final fun getKECCAKF_ROTATION_OFFSETS ()[I
public final fun getKECCAKF_ROUND_CONSTANTS-Y2RjT0g ()[J
Comment on lines +259 to +261
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

}

public final class korlibs/crypto/SHA3Kt {
public static final fun sha3_224 ([B)Lkorlibs/crypto/Hash;
public static final fun sha3_256 ([B)Lkorlibs/crypto/Hash;
public static final fun sha3_384 ([B)Lkorlibs/crypto/Hash;
public static final fun sha3_512 ([B)Lkorlibs/crypto/Hash;
}

public final class korlibs/crypto/SHA3_224 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_224;
}

public final class korlibs/crypto/SHA3_256 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_256;
}

public final class korlibs/crypto/SHA3_384 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_384;
}

public final class korlibs/crypto/SHA3_512 : korlibs/crypto/HasherFactory {
public static final field INSTANCE Lkorlibs/crypto/SHA3_512;
}

public final class korlibs/crypto/SHA512 : korlibs/crypto/SHA {
public static final field Companion Lkorlibs/crypto/SHA512$Companion;
public fun <init> ()V
Expand Down
Loading
Loading