diff options
author | Daniel Schadt <kingdread@gmx.de> | 2023-11-27 17:29:30 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2023-11-27 17:29:30 +0100 |
commit | be9d0e07c3377a13f96363fd8bd7925b3ae17778 (patch) | |
tree | 5c14fcba83bd313bb6973b0fb80b39c61632f1b3 /src/hibe/bbg.rs | |
parent | 5dfb7d4461154d50fb5d88f6c9d0c13d3f767f6d (diff) | |
download | hohibe-be9d0e07c3377a13f96363fd8bd7925b3ae17778.tar.gz hohibe-be9d0e07c3377a13f96363fd8bd7925b3ae17778.tar.bz2 hohibe-be9d0e07c3377a13f96363fd8bd7925b3ae17778.zip |
more documentation
Diffstat (limited to 'src/hibe/bbg.rs')
-rw-r--r-- | src/hibe/bbg.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hibe/bbg.rs b/src/hibe/bbg.rs index 06dbb51..28a3407 100644 --- a/src/hibe/bbg.rs +++ b/src/hibe/bbg.rs @@ -8,16 +8,29 @@ use bls12_381_plus::{ }; use rand::Rng; +/// HIBE from Dan Boneh, Xavier Boyen and Eu-Jin Goh (2005). +/// +/// This struct implements the HIBE of Boneh, Boyen and Goh from their paper "Hierarchical Identity +/// Based Encryption with Constant Size Ciphertext" (2005) ([eprint][eprint]). +/// +/// The underlying bilinear curve is BLS12-381. +/// +/// [eprint]: https://eprint.iacr.org/2005/015.pdf #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct BonehBoyenGoh { max_depth: usize, } impl BonehBoyenGoh { + /// Constructs a new BBG HIBE algorithm suitable for identites up to the given depth. + /// + /// Note that this method only sets up the algorithm definition, it does not draw any keys yet. + /// See [`Hibe::setup`] for that. pub fn new(max_depth: usize) -> Self { Self { max_depth } } + /// Returns the maximum depth that this instance supports. pub fn max_depth(&self) -> usize { self.max_depth } |