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

Suggestion for PR #52 #69

Merged
merged 80 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
9b27efb
Move new methods to clean PR
lealobanov Jul 4, 2024
5f25d22
Move new methods to clean PR
lealobanov Jul 4, 2024
7b68617
Add missing fields
lealobanov Jul 6, 2024
b6f17f4
Add missing fields
lealobanov Jul 6, 2024
b59c1dc
Setting up multi-module project structure
lealobanov Jul 10, 2024
cadd0d6
Setting up multi-module project structure
lealobanov Jul 10, 2024
36d1954
Updates to GH actions workflows
lealobanov Jul 12, 2024
3e3e9a5
Linting kotlin-example
lealobanov Jul 12, 2024
56bc4bc
Debugging GH actions
lealobanov Jul 12, 2024
e15455a
Debugging GH actions
lealobanov Jul 12, 2024
9073a9f
Debugging GH actions
lealobanov Jul 13, 2024
c1195e6
Debugging GH actions
lealobanov Jul 13, 2024
78b9ff4
Debugging GH actions
lealobanov Jul 13, 2024
efde813
Debugging GH actions
lealobanov Jul 13, 2024
cc41ae5
Debugging GH actions
lealobanov Jul 13, 2024
ab2ec53
Debugging GH actions
lealobanov Jul 13, 2024
7889700
Debugging GH actions
lealobanov Jul 13, 2024
b51bd0a
Debugging GH actions
lealobanov Jul 13, 2024
269900f
Debugging GH actions
lealobanov Jul 13, 2024
2edee7e
Debugging GH actions
lealobanov Jul 13, 2024
7d420d8
Debugging GH actions
lealobanov Jul 13, 2024
a30ba90
Setting up java-example module
lealobanov Jul 13, 2024
44641ed
Setting up java-example module
lealobanov Jul 13, 2024
b769cd9
Functional flow.json
lealobanov Jul 13, 2024
1521184
Create GH action for java examples
lealobanov Jul 13, 2024
af4b17c
Merge pull request #61 from onflow/access-api-methods-v3
franklywatson Jul 15, 2024
27214db
Fix java example tests
lealobanov Jul 16, 2024
eb77e0e
Fix java example tests
lealobanov Jul 16, 2024
743df77
Fix java example tests
lealobanov Jul 16, 2024
f1f37f6
Fix java example tests
lealobanov Jul 16, 2024
7571804
Fix kotlin example tests
lealobanov Jul 16, 2024
f9fea75
Updating documentation
lealobanov Jul 17, 2024
36d8b11
Updating documentation
lealobanov Jul 17, 2024
93fe558
Updating documentation
lealobanov Jul 17, 2024
ce46f1e
Updating documentation
lealobanov Jul 17, 2024
5dabb4d
Updating documentation
lealobanov Jul 17, 2024
a6b402a
Updating GH actions
lealobanov Jul 17, 2024
ca99408
Updating GH actions
lealobanov Jul 17, 2024
83dd72d
Setting up script loader for Cadence scripts
lealobanov Jul 18, 2024
a01d9f6
Setting up script loader for Cadence scripts
lealobanov Jul 18, 2024
6adb589
Setting up script loader for Cadence scripts
lealobanov Jul 18, 2024
a85db2b
Refactor
lealobanov Jul 18, 2024
f0d2c9d
Refactor
lealobanov Jul 18, 2024
7bd366a
Refactor
lealobanov Jul 18, 2024
e8122ac
Update JSON Cadence tests to load from external snippets
lealobanov Jul 18, 2024
f91293a
Update JSON Cadence tests to load from external snippets
lealobanov Jul 18, 2024
e48867a
Linting
lealobanov Jul 18, 2024
0ede393
Debugging tests
lealobanov Jul 18, 2024
f4238a2
Minor typo
franklywatson Jul 19, 2024
4c47f74
Merge pull request #64 from onflow/cadence-files
lealobanov Jul 19, 2024
0f58b07
Update NOTICE
lealobanov Jul 19, 2024
5ae4a45
Update NOTICE
lealobanov Jul 19, 2024
688473e
Delete NOTICE file
lealobanov Jul 19, 2024
202207e
Delete NOTICE file
lealobanov Jul 19, 2024
ba14488
Refactor class names
lealobanov Jul 19, 2024
880952c
Refactor class names
lealobanov Jul 19, 2024
d37c3e2
Update sdk/src/test/kotlin/org/onflow/flow/sdk/TestUtils.kt
lealobanov Jul 19, 2024
920b506
Update sdk/src/intTest/org/onflow/flow/sdk/IntegrationTestUtils.kt
lealobanov Jul 19, 2024
88089d8
Debugging examples tests
lealobanov Jul 19, 2024
2f48d33
Merge remote-tracking branch 'origin/examples' into examples
lealobanov Jul 19, 2024
c99ff47
Debugging examples tests
lealobanov Jul 19, 2024
7adc8d9
Debugging examples tests, update git ignore
lealobanov Jul 19, 2024
0d66957
Debugging examples tests, update git ignore
lealobanov Jul 19, 2024
26af3e0
Merge pull request #63 from onflow/access-api-methods-v2
lealobanov Jul 20, 2024
f92cf39
Move inline JSON to standalone files
lealobanov Jul 20, 2024
36dfe1e
Merge branch 'main' of https://github.com/onflow/flow-jvm-sdk into ex…
lealobanov Jul 21, 2024
5e0abd1
Merge pull request #62 from onflow/examples
lealobanov Jul 21, 2024
2dfff06
add KMAC test with 48-bytes output-size
Jul 23, 2024
db86f91
use KMAC128 minimum output size as hash size
Jul 23, 2024
26f8692
Merge pull request #65 from onflow/json-files
franklywatson Jul 23, 2024
4266556
remove old failing test of KMAC128 with 48-bytes output
Jul 23, 2024
4048c1e
Fix kotlin link build error
franklywatson Jul 23, 2024
6bcdbb0
Fix kotlin link build error
franklywatson Jul 23, 2024
3156357
Fix kotlin link build errors
franklywatson Jul 23, 2024
fdf3e0a
update HashImpl to enforce key and custmizer aren't used outside of KMAC
Jul 24, 2024
06ed3d1
extend tests for invalid values of keys, customizers and output sizes…
Jul 24, 2024
8891a0a
remove obsolete hash tests and add test for invalid hasher input
Jul 24, 2024
090bb7d
fix the default output size
Jul 24, 2024
fc5b9ae
Rebase + fix build
lealobanov Jul 24, 2024
a09aaff
Linting build
lealobanov Jul 24, 2024
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
2 changes: 1 addition & 1 deletion src/main/kotlin/org/onflow/flow/sdk/models.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ enum class HashAlgorithm(
UNKNOWN("unknown", -1, -1, 0),
SHA2_256("SHA-256", 256, 1, 1),
SHA3_256("SHA3-256", 256, 3, 2),
KMAC128("KMAC128", 128, 5, 3),
KMAC128("KMAC128", 256, 5, 3),
KECCAK256("KECCAK256", 256, 6, 4);


Expand Down
44 changes: 29 additions & 15 deletions src/test/kotlin/org/onflow/flow/sdk/crypto/CryptoTest.kt
tarakby marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,39 @@ internal class CryptoTest {
fun `Sanity check KMAC128`() {
val input = byteArrayOf(0x00, 0x01, 0x02, 0x03)
val expected = listOf(
listOf(
hexStringToByteArray("E5780B0D3EA6F7D3A429C5706AA43A00FADBD7D49628839E3187243F456EE14E"),
hexStringToByteArray("3B1FBA963CD8B0B59E8C1A6D71888B7143651AF8BA0A7070C0979E2811324AA5")
)
),
listOf(
hexStringToByteArray("4f5967393bd357c13cf1b0aff13c2abe075dd68edee33d6b8cb06f5b2a4d5232c11b439f3c20b20a4f04b0549d9caa10"),
hexStringToByteArray("99d9364ab5d2b748cb843b27f5a4f4fb06ea87306fa141a676cbb4b39c5c5f12d36b7b76aeea81c4f5876e16e6783e72")
)
)
val key = hexStringToByteArray("404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F")
val customizers = listOf("".toByteArray(), "My Tagged Application".toByteArray())
val outputSize = 32
val customizers = listOf(
"".toByteArray(),
"My Tagged Application".toByteArray()
)
val outputSize = listOf(
32,
48
)

customizers.forEachIndexed { index, customizer ->
// Test full input processing
val hasher1 = HasherImpl(HashAlgorithm.KMAC128, key, customizer, outputSize)
val hash1 = hasher1.hash(input)
assertArrayEquals(expected[index], hash1)

// Test incremental input processing
val hasher2 = HasherImpl(HashAlgorithm.KMAC128, key, customizer, outputSize)
hasher2.update(input, 0, 2)
hasher2.update(input, 2, input.size - 2)
val hash2 = hasher2.doFinal(outputSize)
assertArrayEquals(expected[index], hash2)
outputSize.forEachIndexed { indexSize, size ->
customizers.forEachIndexed { index, customizer ->
// Test full input processing
val hasher1 = HasherImpl(HashAlgorithm.KMAC128, key, customizer, size)
val hash1 = hasher1.hash(input)
assertArrayEquals(expected[indexSize][index], hash1)

// Test incremental input processing
val hasher2 = HasherImpl(HashAlgorithm.KMAC128, key, customizer, size)
hasher2.update(input, 0, 2)
hasher2.update(input, 2, input.size - 2)
val hash2 = hasher2.doFinal(size)
assertArrayEquals(expected[indexSize][index], hash2)
}
}
}

Expand Down
Loading