def output_filename(output_dir, key_handle, public_id):
parts = [output_dir, key_handle] + pyhsm.util.group(public_id, <NUM_LIT:2>)<EOL>path = os.path.join(*parts)<EOL>if not os.path.isdir(path):<EOL><INDENT>os.makedirs(path)<EOL><DEDENT>return os.path.join(path, public_id)<EOL>
Return an output filename for a generated AEAD. Creates a hashed directory structure
using the last three bytes of the public id to get equal usage.