phoenix_core/
keys.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4//
5// Copyright (c) DUSK NETWORK. All rights reserved.
6
7use dusk_jubjub::{JubJubAffine, JubJubExtended, JubJubScalar};
8
9pub mod public;
10pub mod secret;
11pub mod view;
12
13/// Hashes a JubJub's ExtendedPoint into a JubJub's Scalar using the JubJub's
14/// hash to scalar function
15pub fn hash(p: &JubJubExtended) -> JubJubScalar {
16    JubJubScalar::hash_to_scalar(&JubJubAffine::from(p).to_bytes())
17}