def aes_parse_fields_hex_map
qasim-bend-kit@0.1.0.2 · proof/AES_EnvelopeProof.bend:976
import qasim-bend-kit@0.1.0.2/proof/AES_EnvelopeProof.bend as AESEnvelopeProof
import Base
import qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend as AES
976def aes_parse_fields_hex_map(+nonce: List<&2, U32>,
977 +tag: List<&2, U32>, +ciphertext: List<&2, U32>,
978 nonce_size: {List.length(&2, U32, nonce) == 12n : Nat},
979 tag_size: {List.length(&2, U32, tag) == 16n : Nat}) ->
980 {Result.map(&2, &2, AES.Error, AES.Envelope, String, AES.encode,
981 AES.parse_fields(["v1", AES.hex_bytes(nonce),
982 AES.hex_bytes(tag), AES.hex_bytes(ciphertext)])) ==
983 Done{"v1." ++ AES.hex_bytes(nonce) ++ "." ++ AES.hex_bytes(tag) ++
984 "." ++ AES.hex_bytes(ciphertext)} :
985 Result<&2, &2, AES.Error, String>}:
986 aes_parse_decoded_hex_map(nonce, tag, ciphertext,
987 nonce_size, tag_size)