You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val password ="01234567890123456789012345678901".toByteArray()
30
+
val data ="MESSAGE_1".toByteArray()
19
31
val salt ="SALT_1".toByteArray()
20
32
21
-
val encryptedSecret = encrypt(CipherVersion.V1, secret, password, salt)
33
+
val encryptedData = encrypt(CipherVersion.V1, data, password, salt)
34
+
35
+
val aegisSecretData =TestAegisSecret(
36
+
listOf(
37
+
TestWallet(
38
+
"xpla1xxxx",
39
+
"name1",
40
+
"publicKey1",
41
+
encryptedData
42
+
)
43
+
)
44
+
)
45
+
46
+
val secret = gson.toJson(aegisSecretData).toByteArray()
22
47
23
48
val aegis =Aegis.dealShares(
24
49
ProtocolVersion.V1,
25
50
Algorithm.NO_CRYPT,
26
51
3,
27
52
3,
28
-
encryptedSecret,
53
+
secret,
29
54
)
30
55
31
56
val token ="eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ5b3VuZ0BkZWxpZ2h0bGFicy5pbyIsImV4cCI6MTc0Njc4NDczMCwianRpIjoiOGJmYTVkMjgtZjkxZi00YmQ3LTgxYTMtZGM4NjllYWVkNmYyIiwic3NvX3Byb3ZpZGVyIjoiR29vZ2xlIn0.ukJ0gYQsZRE8gktRtzxA6cfPH97zWzwLTmU8DODX9sOSwnLPJ0dFFssTbQm0WE-Cfl95COAAl6WwuQ6NSVEIDg"
@@ -44,8 +69,10 @@ class CitadelUnitTest {
44
69
45
70
val encryptedRes =Aegis.combineShares(retrieved)
46
71
47
-
val decryptedRes = decrypt(encryptedRes, password, salt)
48
-
assert(decryptedRes.contentEquals(secret))
72
+
val resAegisSecret = gson.fromJson(String(encryptedRes), TestAegisSecret::class.java)
73
+
74
+
val decryptedRes = decrypt(resAegisSecret.wallet[0].encrypted, password, salt)
0 commit comments