Lines Matching full:secret
38 /// Hash all data at once using the provided seed and a secret
44 let mut secret = DEFAULT_SECRET_RAW; in oneshot_with_seed() localVariable
46 // We know that the secret will only be used if we have more in oneshot_with_seed()
49 derive_secret(seed, &mut secret); in oneshot_with_seed()
52 let secret = Secret::new(&secret).expect("The default secret length is invalid"); in oneshot_with_seed() localVariable
54 impl_oneshot(secret, seed, input) in oneshot_with_seed()
57 /// Hash all data at once using the provided secret and the
61 pub fn oneshot_with_secret(secret: &[u8], input: &[u8]) -> Result<u64, OneshotWithSecretError> { in oneshot_with_secret()
62 let secret = Secret::new(secret).map_err(OneshotWithSecretError)?; in oneshot_with_secret() localVariable
63 Ok(impl_oneshot(secret, DEFAULT_SEED, input)) in oneshot_with_secret()
66 /// Hash all data at once using the provided seed and secret. If
72 secret: &[u8], in oneshot_with_seed_and_secret()
75 let secret = if input.len() > CUTOFF { in oneshot_with_seed_and_secret() localVariable
76 Secret::new(secret).map_err(OneshotWithSecretError)? in oneshot_with_seed_and_secret()
81 Ok(impl_oneshot(secret, seed, input)) in oneshot_with_seed_and_secret()
93 /// Constructs the hasher using the default seed and secret values.
101 /// Constructs the hasher using the provided seed and a secret
110 /// Constructs the hasher using the provided seed and secret.
113 secret: impl Into<Box<[u8]>>, in with_seed_and_secret()
116 inner: RawHasherCore::allocate_with_seed_and_secret(seed, secret)?, in with_seed_and_secret()
121 /// Returns the secret.
149 /// The algorithm requires a secret which can be a reasonably large
158 /// Construct the hasher with the provided seed, secret, and
164 /// Returns the secret.
191 fn small(&self, secret: &Secret, seed: u64, input: &[u8]) -> Self::Output { in small() argument
192 impl_oneshot(secret, seed, input) in small()
202 secret: &Secret, argument
205 Algorithm(vector).finalize_64(acc, last_block, last_stripe, secret, len)
210 fn impl_oneshot(secret: &Secret, seed: u64, input: &[u8]) -> u64 { in impl_oneshot() argument
212 241.. => impl_241_plus_bytes(secret, input), in impl_oneshot()
214 129..=240 => impl_129_to_240_bytes(secret, seed, input), in impl_oneshot()
216 17..=128 => impl_17_to_128_bytes(secret, seed, input), in impl_oneshot()
218 9..=16 => impl_9_to_16_bytes(secret, seed, input), in impl_oneshot()
220 4..=8 => impl_4_to_8_bytes(secret, seed, input), in impl_oneshot()
222 1..=3 => impl_1_to_3_bytes(secret, seed, input), in impl_oneshot()
224 0 => impl_0_bytes(secret, seed), in impl_oneshot()
229 fn impl_0_bytes(secret: &Secret, seed: u64) -> u64 { in impl_0_bytes() argument
230 let secret_words = secret.for_64().words_for_0(); in impl_0_bytes()
235 fn impl_1_to_3_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u64 { in impl_1_to_3_bytes() argument
239 let secret_words = secret.for_64().words_for_1_to_3(); in impl_1_to_3_bytes()
242 let secret = (secret_words[0] ^ secret_words[1]).into_u64(); in impl_1_to_3_bytes() localVariable
243 secret.wrapping_add(seed) ^ combined.into_u64() in impl_1_to_3_bytes()
251 fn impl_4_to_8_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u64 { in impl_4_to_8_bytes() argument
257 let secret_words = secret.for_64().words_for_4_to_8(); in impl_4_to_8_bytes()
275 fn impl_9_to_16_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u64 { in impl_9_to_16_bytes() argument
280 let secret_words = secret.for_64().words_for_9_to_16(); in impl_9_to_16_bytes()
295 fn impl_17_to_128_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u64 { in impl_17_to_128_bytes() argument
299 impl_17_to_128_bytes_iter(secret, input, |fwd, bwd, secret| { in impl_17_to_128_bytes()
300 acc = acc.wrapping_add(mix_step(fwd, &secret[0], seed)); in impl_17_to_128_bytes()
301 acc = acc.wrapping_add(mix_step(bwd, &secret[1], seed)); in impl_17_to_128_bytes()
308 fn impl_129_to_240_bytes(secret: &Secret, seed: u64, input: &[u8]) -> u64 { in impl_129_to_240_bytes() argument
315 let ss = secret.for_64().words_for_127_to_240_part1(); in impl_129_to_240_bytes()
316 for (chunk, secret) in head.by_ref().zip(ss).take(8) { in impl_129_to_240_bytes()
317 acc = acc.wrapping_add(mix_step(chunk, secret, seed)); in impl_129_to_240_bytes()
322 let ss = secret.for_64().words_for_127_to_240_part2(); in impl_129_to_240_bytes()
323 for (chunk, secret) in head.zip(ss) { in impl_129_to_240_bytes()
324 acc = acc.wrapping_add(mix_step(chunk, secret, seed)); in impl_129_to_240_bytes()
328 let ss = secret.for_64().words_for_127_to_240_part3(); in impl_129_to_240_bytes()
335 fn impl_241_plus_bytes(secret: &Secret, input: &[u8]) -> u64 { in impl_241_plus_bytes() argument
338 fn oneshot_impl<>(secret: &Secret, input: &[u8]) -> u64 in impl_241_plus_bytes()
344 fn oneshot_impl(vector: impl Vector, secret: &Secret, input: &[u8]) -> u64 { in oneshot_impl() argument
345 Algorithm(vector).oneshot(secret, input, Finalize64) in oneshot_impl()