mirror of
https://github.com/zkemail/zk-email-verify.git
synced 2026-01-10 05:58:08 -05:00
circuit: update base64 doc
This commit is contained in:
@@ -5,8 +5,11 @@ include "circomlib/circuits/comparators.circom";
|
||||
|
||||
/// @title Base64Decode
|
||||
/// @notice Decodes a Base64 encoded string to array of bytes.
|
||||
/// @notice Only support inputs with length = `byteLength` (no 0 padding).
|
||||
/// @notice It is known that padding char '=' can be replaed with `A` to produce the same output
|
||||
/// as Base64Lookup returns `0` for both, but a pracical attack from this is unlikely.
|
||||
/// @param byteLength Byte length of the encoded value - length of the output array.
|
||||
/// @input in Base64 encoded string; assumes input to be valid Base64 character (though constrained implicitly).
|
||||
/// @input in Base64 encoded string; assumes elements to be valid Base64 characters.
|
||||
/// @output out Decoded array of bytes.
|
||||
template Base64Decode(byteLength) {
|
||||
var charLength = 4 * ((byteLength + 2) \ 3); // 4 chars encode 3 bytes
|
||||
|
||||
Reference in New Issue
Block a user