Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dup-crypto-rs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
libs
dup-crypto-rs
Commits
658224d8
Commit
658224d8
authored
5 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[doc] create summary + add sha256 example
parent
213208af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#8228
passed
5 years ago
Stage: fmt
Stage: tests
Stage: quality
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/dewif.rs
+13
-3
13 additions, 3 deletions
src/dewif.rs
src/hashs/mod.rs
+18
-0
18 additions, 0 deletions
src/hashs/mod.rs
src/keys/mod.rs
+1
-1
1 addition, 1 deletion
src/keys/mod.rs
src/lib.rs
+10
-0
10 additions, 0 deletions
src/lib.rs
with
42 additions
and
4 deletions
src/dewif.rs
+
13
−
3
View file @
658224d8
...
@@ -13,9 +13,19 @@
...
@@ -13,9 +13,19 @@
// You should have received a copy of the GNU Affero General Public License
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Handle [DEWIF]
(https://git.duniter.org/nodes/common/doc/blob/dewif/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md)
format
//! Handle [DEWIF]
[dewif-spec]
format
//!
//!
//! # Write ed25519 key-pair in DEWIF file
//! See [DEWIF format specifications][dewif-spec].
//!
//! [dewif-spec]: https://git.duniter.org/documents/rfcs/blob/dewif/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md
//!
//! # Summary
//!
//! * [Write DEWIF file](#write-ed25519-key-pair-in-dewif-file)
//! * [Read DEWIF file](#read-dewif-file)
//!
//!
//! ## Write ed25519 key-pair in DEWIF file
//!
//!
//! ```
//! ```
//! use dup_crypto::dewif::{Currency, G1_TEST_CURRENCY, write_dewif_v1_content};
//! use dup_crypto::dewif::{Currency, G1_TEST_CURRENCY, write_dewif_v1_content};
...
@@ -40,7 +50,7 @@
...
@@ -40,7 +50,7 @@
//! )
//! )
//! ```
//! ```
//!
//!
//! # Read DEWIF file
//! #
#
Read DEWIF file
//!
//!
//! ```
//! ```
//! use dup_crypto::dewif::{Currency, ExpectedCurrency, read_dewif_file_content};
//! use dup_crypto::dewif::{Currency, ExpectedCurrency, read_dewif_file_content};
...
...
This diff is collapsed.
Click to expand it.
src/hashs/mod.rs
+
18
−
0
View file @
658224d8
...
@@ -14,6 +14,24 @@
...
@@ -14,6 +14,24 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Provide wrappers for cryptographic hashs
//! Provide wrappers for cryptographic hashs
//!
//! # Summary
//!
//! * [Compute Sha256 hash](#compute-sha256-hash)
//!
//! ## Compute sha256 hash
//!
//! ```
//! use dup_crypto::hashs::Hash;
//!
//! let hash: Hash = Hash::compute(b"datas");
//!
//! assert_eq!(
//! "958D41C80EF75834EFFC9CBE2E8AEE11AEDE28ADA596E876B8261EDF53266B40",
//! &hash.to_hex(),
//! );
//! ```
//!
use
crate
::
bases
::
*
;
use
crate
::
bases
::
*
;
#[cfg(feature
=
"rand"
)]
#[cfg(feature
=
"rand"
)]
...
...
This diff is collapsed.
Click to expand it.
src/keys/mod.rs
+
1
−
1
View file @
658224d8
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
//! - Keys can be converted to/from Base58 string format.
//! - Keys can be converted to/from Base58 string format.
//! - Signatures can be converted to/from Base64 string format.
//! - Signatures can be converted to/from Base64 string format.
//!
//!
//! #
Usage
//! #
Generate and use ed25519 key-pair
//!
//!
//! ```
//! ```
//! use dup_crypto::keys::{KeyPair, PublicKey, Signator, Signature};
//! use dup_crypto::keys::{KeyPair, PublicKey, Signator, Signature};
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
10
−
0
View file @
658224d8
...
@@ -17,6 +17,16 @@
...
@@ -17,6 +17,16 @@
//!
//!
//! `dup` means DUniter Protocols.
//! `dup` means DUniter Protocols.
//!
//!
//! ## Summary
//!
//! * [Handle DEWIF format](./dewif/index.html#handle-dewif-format)
//! * [Write DEWIF file](./dewif/index.html#write-ed25519-key-pair-in-dewif-file)
//! * [Read DEWIF file](./dewif/index.html#read-dewif-file)
//! * [Sha256](./hashs/index.html)
//! * [Compute Sha256 hash](./hashs/index.html#compute-sha256-hash)
//! * [Ed25519](./keys/index.html)
//! * [generate and use ed25519 key-pair](./keys/index.html#generate-and-use-ed25519-key-pair)
//!
#![deny(
#![deny(
clippy::option_unwrap_used,
clippy::option_unwrap_used,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment