Skip to content

Commit

Permalink
core: Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
xevisalle committed Dec 11, 2024
1 parent 46af66b commit 6dcc828
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/src/gadgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::{license::LIC_PLAINTEXT_SIZE, License, SessionCookie};
use poseidon_merkle::zk::opening_gadget;

/// The [`use_license`] gadget for the [`LicenseCircuit`]. It is meant
/// to use Citadel licenses onchain. Out of this circuit, the generated
/// to use Citadel licenses on-chain. Out of this circuit, the generated
/// public inputs vector collects these values in that particular order:
///
/// session_id
Expand Down
12 changes: 6 additions & 6 deletions core/src/license.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use dusk_bytes::Serializable;
use dusk_jubjub::dhke;
use dusk_poseidon::{Domain, Hash};
use ff::Field;
use jubjub_schnorr::{SecretKey as NoteSecretKey, Signature};
use jubjub_schnorr::{SecretKey as LicenseSecretKey, Signature};
use phoenix_core::{
aes::{decrypt, encrypt, ENCRYPTION_EXTRA_SIZE},
Error, PublicKey, SecretKey, StealthAddress,
Expand All @@ -26,9 +26,9 @@ use crate::request::{Request, REQ_PLAINTEXT_SIZE};
pub(crate) const LIC_PLAINTEXT_SIZE: usize = Signature::SIZE + JubJubScalar::SIZE;
const LIC_ENCRYPTION_SIZE: usize = LIC_PLAINTEXT_SIZE + ENCRYPTION_EXTRA_SIZE;

/// Enumaration used to create new licenses
/// Enumeration used to create new licenses
pub enum LicenseOrigin {
/// From a [`Request`] sent onchain
/// From a [`Request`] sent
FromRequest(Request),
/// From a [`PublicKey`] of a given user
FromPublicKey(PublicKey),
Expand All @@ -54,10 +54,10 @@ impl License {
pub fn new<R: RngCore + CryptoRng>(
attr_data: &JubJubScalar,
sk_lp: &SecretKey,
lc: &LicenseOrigin,
lo: &LicenseOrigin,
rng: &mut R,
) -> Result<Self, Error> {
let (lsa, k_lic) = match lc {
let (lsa, k_lic) = match lo {
LicenseOrigin::FromRequest(req) => {
let k_dh = dhke(sk_lp.a(), req.rsa.R());
let dec: [u8; REQ_PLAINTEXT_SIZE] = decrypt(&k_dh, &req.enc)?;
Expand Down Expand Up @@ -89,7 +89,7 @@ impl License {
Domain::Other,
&[lpk.get_u(), lpk.get_v(), BlsScalar::from(*attr_data)],
)[0];
let sig_lic = NoteSecretKey::from(sk_lp.a()).sign(rng, message);
let sig_lic = LicenseSecretKey::from(sk_lp.a()).sign(rng, message);

let mut plaintext = sig_lic.to_bytes().to_vec();
plaintext.append(&mut attr_data.to_bytes().to_vec());
Expand Down
2 changes: 1 addition & 1 deletion core/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use rkyv::{Archive, Deserialize, Serialize};
use dusk_plonk::prelude::*;

/// The struct defining a Citadel session, a set of public values shared
/// onchain that represent the use of a service by an unknown user
/// on-chain that represent the use of a service by an unknown user
#[cfg_attr(
feature = "rkyv-impl",
derive(Archive, Serialize, Deserialize),
Expand Down

0 comments on commit 6dcc828

Please sign in to comment.