(protocol_label: &[u8])
| 65 | |
| 66 | impl Strobe128 { |
| 67 | pub fn new(protocol_label: &[u8]) -> Strobe128 { |
| 68 | let initial_state = { |
| 69 | let mut st = AlignedKeccakState([0u8; 200]); |
| 70 | st[0..6].copy_from_slice(&[1, STROBE_R + 2, 1, 0, 1, 96]); |
| 71 | st[6..18].copy_from_slice(b"STROBEv1.0.2"); |
| 72 | keccak::f1600(transmute_state(&mut st)); |
| 73 | |
| 74 | st |
| 75 | }; |
| 76 | |
| 77 | let mut strobe = Strobe128 { |
| 78 | state: initial_state, |
| 79 | pos: 0, |
| 80 | pos_begin: 0, |
| 81 | cur_flags: 0, |
| 82 | }; |
| 83 | |
| 84 | strobe.meta_ad(protocol_label, false); |
| 85 | |
| 86 | strobe |
| 87 | } |
| 88 | |
| 89 | pub fn meta_ad(&mut self, data: &[u8], more: bool) { |
| 90 | self.begin_op(FLAG_M | FLAG_A, more); |
nothing calls this directly
no test coverage detected