Merge branch 'hs_descencnonce' into 'main'

Rename DescEncNonce => HsDescEncNonce

See merge request tpo/core/arti!1014
This commit is contained in:
Ian Jackson 2023-02-09 14:54:49 +00:00
commit 34dcb6004e
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ pub(super) struct HsDescEncryption<'a> {
/// For the encryption layer, it is `descriptor_cookie` (2.5.2.1)
/// which is present when descriptor-encryption authentication via
/// `KP_hsc_desc_enc` is in use.
pub(super) desc_enc_nonce: Option<&'a DescEncNonce>,
pub(super) desc_enc_nonce: Option<&'a HsDescEncNonce>,
/// The "subcredential" of the onion service.
pub(super) subcredential: &'a Subcredential,
/// The current revision of the onion service descriptor being decrypted.
@ -47,7 +47,7 @@ pub(super) struct HsDescEncryption<'a> {
/// This is `N_hs_desc_enc` in the spec, where sometimes we also call it a
/// "descriptor cookie".
#[derive(derive_more::AsRef, derive_more::From)]
pub(super) struct DescEncNonce([u8; 16]);
pub(super) struct HsDescEncNonce([u8; 16]);
/// Length of our cryptographic salt.
const SALT_LEN: usize = 16;

View File

@ -12,7 +12,7 @@ use crate::parse::{keyword::Keyword, parser::SectionRules};
use crate::types::misc::B64;
use crate::{Pos, Result};
use super::desc_enc::{DescEncNonce, HsDescEncryption};
use super::desc_enc::{HsDescEncNonce, HsDescEncryption};
use super::DecryptionError;
/// A more-or-less verbatim representation of the middle document of an onion
@ -78,7 +78,7 @@ impl HsDescMiddle {
&self,
subcredential: &Subcredential,
ks_hsc_desc_enc: &HsClientDescEncSecretKey,
) -> Option<DescEncNonce> {
) -> Option<HsDescEncNonce> {
use cipher::{KeyIvInit, StreamCipher};
use digest::{ExtendableOutput, Update};
use tor_llcrypto::cipher::aes::Aes256Ctr as Cipher;