MCPcopy Create free account
hub / github.com/docknetwork/crypto / new

Method new

merlin/src/strobe.rs:67–87  ·  view source on GitHub ↗
(protocol_label: &[u8])

Source from the content-addressed store, hash-verified

65
66impl 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);

Callers

nothing calls this directly

Calls 3

AlignedKeccakStateClass · 0.85
transmute_stateFunction · 0.85
meta_adMethod · 0.80

Tested by

no test coverage detected