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

Method begin_op

merlin/src/strobe.rs:151–181  ·  view source on GitHub ↗
(&mut self, flags: u8, more: bool)

Source from the content-addressed store, hash-verified

149 }
150
151 fn begin_op(&mut self, flags: u8, more: bool) {
152 // Check if we're continuing an operation
153 if more {
154 assert_eq!(
155 self.cur_flags, flags,
156 "You tried to continue op {:#b} but changed flags to {:#b}",
157 self.cur_flags, flags,
158 );
159 return;
160 }
161
162 // Skip adjusting direction information (we just use AD, PRF)
163 assert_eq!(
164 flags & FLAG_T,
165 0u8,
166 "You used the T flag, which this implementation doesn't support"
167 );
168
169 let old_begin = self.pos_begin;
170 self.pos_begin = self.pos + 1;
171 self.cur_flags = flags;
172
173 self.absorb(&[old_begin, flags]);
174
175 // Force running F if C or K is set
176 let force_f = 0 != (flags & (FLAG_C | FLAG_K));
177
178 if force_f && self.pos != 0 {
179 self.run_f();
180 }
181 }
182}
183
184impl Deref for AlignedKeccakState {

Callers 4

meta_adMethod · 0.80
adMethod · 0.80
prfMethod · 0.80
keyMethod · 0.80

Calls 2

absorbMethod · 0.80
run_fMethod · 0.80

Tested by

no test coverage detected