• Home
  • Raw
  • Download

Lines Matching full:secret

5 /// A buffer containing the secret bytes.
12 /// A mutable buffer to contain the secret bytes.
44 /// Holds secret and temporary buffers that are ensured to be
49 secret: S, field
54 /// Returns the secret.
56 self.secret in into_secret()
64 /// Takes the seed, secret, and buffer and performs no
67 pub fn new(seed: u64, secret: S) -> Result<Self, SecretTooShortError<S>> { in new()
68 match Secret::new(secret.as_ref()) { in new()
71 secret, in new()
74 Err(e) => Err(SecretTooShortError(e, secret)), in new()
81 let secret = self.secret.as_ref(); in is_valid() localVariable
83 secret.len() >= SECRET_MINIMUM_LENGTH in is_valid()
88 Self::secret(&self.secret).n_stripes() in n_stripes()
92 fn parts(&self) -> (u64, &Secret, &Buffer) { in parts() argument
93 (self.seed, Self::secret(&self.secret), &self.buffer) in parts()
97 fn parts_mut(&mut self) -> (u64, &Secret, &mut Buffer) { in parts_mut() argument
98 (self.seed, Self::secret(&self.secret), &mut self.buffer) in parts_mut()
101 fn secret(secret: &S) -> &Secret { in secret() argument
102 let secret = secret.as_ref(); in secret() localVariable
105 unsafe { Secret::new_unchecked(secret) } in secret()
113 /// Fills the secret buffer with a secret derived from the seed
114 /// and the default secret. The secret must be exactly
116 pub fn with_seed(seed: u64, mut secret: S) -> Result<Self, SecretWithSeedError<S>> { in with_seed()
117 match <&mut DefaultSecret>::try_from(secret.as_mut()) { in with_seed()
124 secret, in with_seed()
128 Err(_) => Err(SecretWithSeedError(secret)), in with_seed()
134 /// Use the default seed and secret values while allocating nothing.
139 secret: &DEFAULT_SECRET_RAW, in default()
212 let (_, secret, buffer) = secret_buffer.parts_mut(); in write_impl()
247 stripe_accumulator.process_stripe(vector, stripe, n_stripes, secret); in write_impl()
270 stripe_accumulator.process_stripe(vector, stripe, n_stripes, secret) in write_impl()
307 let (seed, secret, buffer) = secret_buffer.parts(); in finish_impl()
321 stripe_accumulator.process_stripe(vector, stripe, n_stripes, secret); in finish_impl()
345 secret, in finish_impl()
356 fn small(&self, secret: &Secret, seed: u64, input: &[u8]) -> Self::Output; in small() argument
364 secret: &Secret, argument
385 /// Allocates the secret and temporary buffers and fills them
386 /// with the default seed and secret values.
390 secret: DEFAULT_SECRET_RAW.to_vec().into(), in allocate_default()
395 /// Allocates the secret and temporary buffers and uses the
396 /// provided seed to construct the secret value.
398 let mut secret = DEFAULT_SECRET_RAW; in allocate_with_seed() localVariable
399 derive_secret(seed, &mut secret); in allocate_with_seed()
403 secret: secret.to_vec().into(), in allocate_with_seed()
409 /// and secret buffer.
412 secret: impl Into<Box<[u8]>>, in allocate_with_seed_and_secret()
414 Self::new(seed, secret.into()) in allocate_with_seed_and_secret()
431 secret: impl Into<Box<[u8]>>, in allocate_with_seed_and_secret()
433 SecretBuffer::allocate_with_seed_and_secret(seed, secret).map(Self::new) in allocate_with_seed_and_secret()
442 /// secret we should be using.
463 secret: &Secret, argument
474 // block size, which is determined by the secret size.
475 let secret_stripe = unsafe { secret.stripe(*current_stripe) };
482 let secret_end = secret.last_stripe();
490 /// The provided secret was not exactly [`DEFAULT_SECRET_LENGTH`][]
495 /// Returns the secret.
513 "The secret must be exactly {DEFAULT_SECRET_LENGTH} bytes" in fmt()
518 /// The provided secret was not at least [`SECRET_MINIMUM_LENGTH`][]
520 pub struct SecretTooShortError<S>(secret::Error, S);
523 /// Returns the secret.