@@ -571,17 +571,17 @@ Steps:
5715712. Initialize XOF instances as described in {{xof-init}}
5725723. `encrypted_output = empty byte array`
5735734. For each component :
574- - Update `components_xof` with `component`.
575- - ` SIV = components_xof.clone().read(SIVLEN)` .
576- - ` keystream_xof = base_keystream_xof.clone()` .
577- - ` keystream_xof.update(SIV)` .
578- - ` padding_len = (PADBS - (SIVLEN + len(component)) % PADBS) % PADBS` .
579- - ` keystream = keystream_xof.read(len(component) + padding_len)` .
580- - ` padded_component = component concatenated with zeros(padding_len)` .
581- - ` encrypted_part = padded_component XOR keystream` .
582- - ` encrypted_output = encrypted_output concatenated with SIV concatenated with encrypted_part` .
583-
584- 5. `base64_output = base64url_encode(encrypted_output)`.
574+ - Update `components_xof` with `component`
575+ - ` SIV = components_xof.clone().read(SIVLEN)`
576+ - ` keystream_xof = base_keystream_xof.clone()`
577+ - ` keystream_xof.update(SIV)`
578+ - ` padding_len = (PADBS - (SIVLEN + len(component)) % PADBS) % PADBS`
579+ - ` keystream = keystream_xof.read(len(component) + padding_len)`
580+ - ` padded_component = component concatenated with zeros(padding_len)`
581+ - ` encrypted_part = padded_component XOR keystream`
582+ - ` encrypted_output = encrypted_output concatenated with SIV concatenated with encrypted_part`
583+
584+ 5. `base64_output = base64url_encode(encrypted_output)`
5855856. If scheme is not empty : Return `scheme + base64_output`
5865867. Else if original URI started with '/' : Return `'/' + base64_output`
5875878. Else : Return `base64_output`
@@ -599,14 +599,14 @@ Note: For path-only URIs (those starting with '/'), the output format is:
599599Steps :
600600
6016011. Split encrypted URI into scheme and base64 part
602- 2. `decoded = base64url_decode(base64_part)`. If decoding fails, return `error`.
602+ 2. `decoded = base64url_decode(base64_part)` If decoding fails, return `error`
6036033. Initialize XOF instances as described in {{xof-init}}
6046044. `decrypted_components = empty list`
6056055. `position = 0`
6066066. While `position < len(decoded)` :
607- - ` SIV = decoded[position:position+SIVLEN]` . If not enough bytes, return `error`.
608- - ` keystream_xof = base_keystream_xof.clone()` .
609- - ` keystream_xof.update(SIV)` .
607+ - ` SIV = decoded[position:position+SIVLEN]` If not enough bytes, return `error`
608+ - ` keystream_xof = base_keystream_xof.clone()`
609+ - ` keystream_xof.update(SIV)`
610610 - ` component_start = position + SIVLEN`
611611 - ` component = empty byte array`
612612 - ` position = position + SIVLEN`
@@ -619,12 +619,12 @@ Steps:
619619 - ` total_len = position - component_start`
620620 - ` position = position + ((PADBS - ((SIVLEN + total_len) % PADBS)) % PADBS)`
621621 - Break inner loop
622- - Update `components_xof` with `component`.
623- - ` expected_SIV = components_xof.clone().read(SIVLEN)` .
624- - If `constant_time_compare(SIV, expected_SIV) == false`, return `error`.
625- - ` decrypted_components.append(component)` .
622+ - Update `components_xof` with `component`
623+ - ` expected_SIV = components_xof.clone().read(SIVLEN)`
624+ - If `constant_time_compare(SIV, expected_SIV) == false`, return `error`
625+ - ` decrypted_components.append(component)`
626626
627- 7. `decrypted_path = join(decrypted_components)`.
627+ 7. `decrypted_path = join(decrypted_components)`
6286288. Return `scheme + decrypted_path`
629629
630630# Implementation Details
0 commit comments