utils library

Constants

MAX_AUD_VALUE_LENGTH → const int
Maximum length of an OAuth aud value supported by zkLogin.
MAX_KEY_CLAIM_NAME_LENGTH → const int
Maximum length of an OAuth key-claim name supported by zkLogin.
MAX_KEY_CLAIM_VALUE_LENGTH → const int
Maximum length of an OAuth key-claim value supported by zkLogin.
PACK_WIDTH → const int
Bit width used when packing ASCII strings into field elements.

Functions

bytesBEToBigInt(List<int> bytes) BigInt
Interprets bytes as a big-endian unsigned integer.
chunkArray<T>(List<T> array, int chunkSize) List<List<T>>
Splits array into chunks of size chunkSize. If the array is not evenly divisible by chunkSize, the first chunk will be smaller than chunkSize.
genAddressSeed(BigInt salt, String name, String value, String aud, {int maxNameLength = MAX_KEY_CLAIM_NAME_LENGTH, int maxValueLength = MAX_KEY_CLAIM_VALUE_LENGTH, int maxAudLength = MAX_AUD_VALUE_LENGTH}) BigInt
Generates the zkLogin address seed from the user's salt, the OAuth claim identified by name/value, and the token's aud.
getExtendedEphemeralPublicKey(PublicKey publicKey) String
Returns the extended ephemeral public key for publicKey as a decimal string, the form expected by the Sui zkLogin prover.
hashASCIIStrToField(String str, int maxSize) BigInt
Hashes an ASCII str to a single field element, padding with zero bytes up to maxSize. Throws an ArgumentError if str is longer than maxSize.