• Home
  • Raw
  • Download

Lines Matching full:secret

37     /// Hash all data at once using the provided seed and a secret
43 let mut secret = DEFAULT_SECRET_RAW; in oneshot_with_seed() localVariable
45 // We know that the secret will only be used if we have more in oneshot_with_seed()
48 derive_secret(seed, &mut secret); in oneshot_with_seed()
51 let secret = Secret::new(&secret).expect("The default secret length is invalid"); in oneshot_with_seed() localVariable
53 impl_oneshot(secret, seed, input) in oneshot_with_seed()
56 /// Hash all data at once using the provided secret and the
61 secret: &[u8], in oneshot_with_secret()
64 let secret = Secret::new(secret).map_err(OneshotWithSecretError)?; in oneshot_with_secret() localVariable
65 Ok(impl_oneshot(secret, DEFAULT_SEED, input)) in oneshot_with_secret()
68 /// Hash all data at once using the provided seed and secret. If
74 secret: &[u8], in oneshot_with_seed_and_secret()
77 let secret = if input.len() > CUTOFF { in oneshot_with_seed_and_secret() localVariable
78 Secret::new(secret).map_err(OneshotWithSecretError)? in oneshot_with_seed_and_secret()
83 Ok(impl_oneshot(secret, seed, input)) in oneshot_with_seed_and_secret()
94 /// Constructs the hasher using the default seed and secret values.
102 /// Constructs the hasher using the provided seed and a secret
111 /// Constructs the hasher using the provided seed and secret.
114 secret: impl Into<Box<[u8]>>, in with_seed_and_secret()
117 inner: RawHasherCore::allocate_with_seed_and_secret(seed, secret)?, in with_seed_and_secret()
122 /// Returns the secret.
153 /// The algorithm requires a secret which can be a reasonably large
162 /// Construct the hasher with the provided seed, secret, and
168 /// Returns the secret.
200 fn small(&self, secret: &Secret, seed: u64, input: &[u8]) -> Self::Output { in small() argument
201 impl_oneshot(secret, seed, input) in small()
211 secret: &Secret, argument
214 Algorithm(vector).finalize_128(acc, last_block, last_stripe, secret, len)
219 fn impl_oneshot(secret: &Secret, seed: u64, input: &[u8]) -> u128 { in impl_oneshot() argument
221 241.. => impl_241_plus_bytes(secret, input), in impl_oneshot()
223 129..=240 => impl_129_to_240_bytes(secret, seed, input), in impl_oneshot()
225 17..=128 => impl_17_to_128_bytes(secret, seed, input), in impl_oneshot()
227 9..=16 => impl_9_to_16_bytes(secret, seed, input), in impl_oneshot()
229 4..=8 => impl_4_to_8_bytes(secret, seed, input), in impl_oneshot()
231 1..=3 => impl_1_to_3_bytes(secret, seed, input), in impl_oneshot()
233 0 => impl_0_bytes(secret, seed), in impl_oneshot()
238 fn impl_0_bytes(secret: &Secret, seed: u64) -> u128 { in impl_0_bytes() argument
239 let secret_words = secret.for_128().words_for_0(); in impl_0_bytes()
248 fn impl_1_to_3_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u128 { in impl_1_to_3_bytes() argument
252 let secret_words = secret.for_128().words_for_1_to_3(); in impl_1_to_3_bytes()
255 let secret = (secret_words[0] ^ secret_words[1]).into_u64(); in impl_1_to_3_bytes() localVariable
256 secret.wrapping_add(seed) ^ combined.into_u64() in impl_1_to_3_bytes()
259 let secret = (secret_words[2] ^ secret_words[3]).into_u64(); in impl_1_to_3_bytes() localVariable
260 secret.wrapping_sub(seed) ^ combined.swap_bytes().rotate_left(13).into_u64() in impl_1_to_3_bytes()
270 fn impl_4_to_8_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u128 { in impl_4_to_8_bytes() argument
276 let secret_words = secret.for_128().words_for_4_to_8(); in impl_4_to_8_bytes()
303 fn impl_9_to_16_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u128 { in impl_9_to_16_bytes() argument
308 let secret_words = secret.for_128().words_for_9_to_16(); in impl_9_to_16_bytes()
336 fn impl_17_to_128_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u128 { in impl_17_to_128_bytes() argument
341 impl_17_to_128_bytes_iter(secret, input, |fwd, bwd, secret| { in impl_17_to_128_bytes()
342 mix_two_chunks(&mut acc, fwd, bwd, secret, seed); in impl_17_to_128_bytes()
349 fn impl_129_to_240_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u128 { in impl_129_to_240_bytes() argument
357 let ss = secret.for_128().words_for_127_to_240_part1(); in impl_129_to_240_bytes()
358 for (input, secret) in head.by_ref().zip(ss).take(4) { in impl_129_to_240_bytes()
359 mix_two_chunks(&mut acc, &input[0], &input[1], secret, seed); in impl_129_to_240_bytes()
364 let ss = secret.for_128().words_for_127_to_240_part2(); in impl_129_to_240_bytes()
365 for (input, secret) in head.zip(ss) { in impl_129_to_240_bytes()
366 mix_two_chunks(&mut acc, &input[0], &input[1], secret, seed); in impl_129_to_240_bytes()
372 let ss = secret.for_128().words_for_127_to_240_part3(); in impl_129_to_240_bytes()
385 secret: &[[u8; 16]; 2],
391 acc[0] = acc[0].wrapping_add(mix_step(data1, &secret[0], seed));
392 acc[1] = acc[1].wrapping_add(mix_step(data2, &secret[1], seed));
412 fn impl_241_plus_bytes(secret: &Secret, input: &[u8]) -> u128 { in impl_241_plus_bytes() argument
415 fn oneshot_impl<>(secret: &Secret, input: &[u8]) -> u128 in impl_241_plus_bytes()
421 fn oneshot_impl(vector: impl Vector, secret: &Secret, input: &[u8]) -> u128 { in oneshot_impl() argument
422 Algorithm(vector).oneshot(secret, input, Finalize128) in oneshot_impl()