proposition: Lemma queue_into_ByteString_padding_eq : forall l, padding (queue_into_ByteString l) = NPeano.modulo (length l) 8.
proof: Proof. intro; replace (length l) with (length l + bin_measure ByteString_id) by (simpl; rewrite length_ByteString_id; omega). unfold queue_into_ByteString; generalize ByteString_id. induction l; intros; simpl fold_left. - apply padding_eq_mod_8. - simpl fold_left. rewrite IHl. replace bin_measure with length_ByteString by reflexivity. rewrite <- NPeano.Nat.add_mod_idemp_r by omega. rewrite <- NPeano.Nat.add_mod_idemp_r with (b := length_ByteString _) by omega. rewrite <- !padding_eq_mod_8. rewrite ByteString_enqueue_padding_eq. rewrite NPeano.Nat.add_mod_idemp_r by omega. f_equal. simpl; omega. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Bedrock.Word Coq.ZArith.ZArith Coq.NArith.NArith Coq.Arith.Arith Coq.Numbers.Natural.Peano.NPeano Coq.Logic.Eqdep_dec Fiat.Narcissus.Common.Specs Fiat.Narcissus.BinLib.Core Fiat.Narcissus.Formats.ByteBuffer Coq.Strings.String Coq.Vectors.Vector Fiat.Narcissus.Formats.WordOpt Fiat.Common.Equality List