toByteArray should follow the guidelines in the U-Prove doc.