diff --git a/tests/waku_keystore/utils.nim b/tests/waku_keystore/utils.nim index 8af2d2a26..c9a85ee37 100644 --- a/tests/waku_keystore/utils.nim +++ b/tests/waku_keystore/utils.nim @@ -6,9 +6,9 @@ import stint import waku/[waku_keystore/protocol_types, waku_rln_relay, waku_rln_relay/protocol_types] -func fromStrToBytesLe*(v: string): seq[byte] = +func fromStrToBytesBe*(v: string): seq[byte] = try: - return @(hexToUint[256](v).toBytesLE()) + return @(hexToUint[256](v).toBytesBE()) except ValueError: # this should never happen return @[] @@ -18,10 +18,10 @@ func defaultIdentityCredential*(): IdentityCredential = return IdentityCredential( idTrapdoor: default(IdentityTrapdoor), idNullifier: default(IdentityNullifier), - idSecretHash: fromStrToBytesLe( + idSecretHash: fromStrToBytesBe( "7984f7c054ad7793d9f31a1e9f29eaa8d05966511e546bced89961eb8874ab9" ), - idCommitment: fromStrToBytesLe( + idCommitment: fromStrToBytesBe( "51c31de3bff7e52dc7b2eb34fc96813bacf38bde92d27fe326ce5d8296322a7" ), ) diff --git a/waku/waku_keystore/protocol_types.nim b/waku/waku_keystore/protocol_types.nim index eb8e7a69a..abea5e2cd 100644 --- a/waku/waku_keystore/protocol_types.nim +++ b/waku/waku_keystore/protocol_types.nim @@ -53,16 +53,16 @@ proc toIdentityCredentials*( try: let idTrapdoor = IdentityTrapdoor( - @(hexToUint[CredentialByteSize](groupKeys[i][0]).toBytesLE()) + @(hexToUint[CredentialByteSize](groupKeys[i][0]).toBytesBE()) ) idNullifier = IdentityNullifier( - @(hexToUint[CredentialByteSize](groupKeys[i][1]).toBytesLE()) + @(hexToUint[CredentialByteSize](groupKeys[i][1]).toBytesBE()) ) idSecretHash = IdentitySecretHash( - @(hexToUint[CredentialByteSize](groupKeys[i][2]).toBytesLE()) + @(hexToUint[CredentialByteSize](groupKeys[i][2]).toBytesBE()) ) idCommitment = - IDCommitment(@(hexToUint[CredentialByteSize](groupKeys[i][3]).toBytesLE())) + IDCommitment(@(hexToUint[CredentialByteSize](groupKeys[i][3]).toBytesBE())) groupIdCredentials.add( IdentityCredential( idTrapdoor: idTrapdoor, diff --git a/waku/waku_rln_relay/protocol_types.nim b/waku/waku_rln_relay/protocol_types.nim index 867878886..24f1d68e7 100644 --- a/waku/waku_rln_relay/protocol_types.nim +++ b/waku/waku_rln_relay/protocol_types.nim @@ -27,7 +27,7 @@ type RawRateCommitment* = seq[byte] proc toRateCommitment*(rateCommitmentUint: UInt256): RawRateCommitment = - return RawRateCommitment(@(rateCommitmentUint.toBytesLE())) + return RawRateCommitment(@(rateCommitmentUint.toBytesBE())) # Custom data types defined for waku rln relay ------------------------- type RateLimitProof* = object