Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
nodes
rust
Dunitrust
Commits
c84ff91c
Commit
c84ff91c
authored
7 years ago
by
nanocryk
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into 'ci'
# Conflicts: # keys/ed25519.rs # keys/lib.rs
parents
f7479f0e
f072fe69
No related branches found
No related tags found
1 merge request
!6
Apply rustfmt diff in gitlab-CI
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cargo.lock
+50
-53
50 additions, 53 deletions
Cargo.lock
keys/Cargo.toml
+1
-1
1 addition, 1 deletion
keys/Cargo.toml
keys/ed25519.rs
+0
-20
0 additions, 20 deletions
keys/ed25519.rs
keys/lib.rs
+5
-25
5 additions, 25 deletions
keys/lib.rs
with
56 additions
and
99 deletions
Cargo.lock
+
50
−
53
View file @
c84ff91c
...
...
@@ -18,12 +18,12 @@ version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.2
4
(registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.2
7
(registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bitflags"
version = "
0.7.0
"
version = "
1.0.1
"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
...
...
@@ -33,7 +33,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "duniter-keys"
version = "0.
1
.0"
version = "0.
2
.0"
dependencies = [
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
...
...
@@ -45,43 +45,32 @@ name = "duniter-wotb"
version = "0.4.1"
dependencies = [
"bincode 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.2
4
(registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.2
4
(registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.2
7
(registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.2
7
(registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon"
version = "0.
2.1
"
version = "0.
3.3
"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon-sys"
version = "0.
2.0
"
version = "0.
3.3
"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gcc"
version = "0.3.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libc"
version = "0.2.3
4
"
version = "0.2.3
5
"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
...
...
@@ -91,16 +80,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand"
version = "0.3.
18
"
version = "0.3.
20
"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.
2.1
(registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.3
4
(registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon 0.
3.3
(registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.3
5
(registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.3
2
"
version = "0.1.3
7
"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
...
...
@@ -109,10 +98,10 @@ version = "0.2.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.3
4
(registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.
18
(registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.3
5
(registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.
20
(registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.3
8
(registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.3
9
(registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
...
...
@@ -127,22 +116,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
version = "1.0.2
4
"
version = "1.0.2
7
"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_derive"
version = "1.0.2
4
"
version = "1.0.2
7
"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive_internals 0.1
8
.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive_internals 0.1
9
.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_derive_internals"
version = "0.1
8
.0"
version = "0.1
9
.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
...
...
@@ -169,13 +158,12 @@ dependencies = [
[[package]]
name = "time"
version = "0.1.3
8
"
version = "0.1.3
9
"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
...
...
@@ -185,37 +173,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.2.8"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-i686-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-x86_64-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-
build
"
version = "0.
1.1
"
name = "winapi-
x86_64-pc-windows-gnu
"
version = "0.
3.2
"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83"
"checksum base64 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c4a342b450b268e1be8036311e2c613d7f8a7ed31214dff1cc3b60852a3168d"
"checksum bincode 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9a6301db0b49fb63551bc15b5ae348147101cdf323242b93ec7546d5002ff1af"
"checksum bitflags
0.7.0
(registry+https://github.com/rust-lang/crates.io-index)" = "
aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d
"
"checksum bitflags
1.0.1
(registry+https://github.com/rust-lang/crates.io-index)" = "
b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf
"
"checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23"
"checksum fuchsia-zircon 0.
2.1
(registry+https://github.com/rust-lang/crates.io-index)" = "
f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159
"
"checksum fuchsia-zircon-sys 0.
2.0
(registry+https://github.com/rust-lang/crates.io-index)" = "
43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82
"
"checksum fuchsia-zircon 0.
3.3
(registry+https://github.com/rust-lang/crates.io-index)" = "
2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82
"
"checksum fuchsia-zircon-sys 0.
3.3
(registry+https://github.com/rust-lang/crates.io-index)" = "
3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7
"
"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)" = "36fbc8a8929c632868295d0178dd8f63fc423fd7537ad0738372bd010b3ac9b0"
"checksum libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)" = "96264e9b293e95d25bfcbbf8a88ffd1aedc85b754eba8b7d78012f638ba220eb"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum rand 0.3.
18
(registry+https://github.com/rust-lang/crates.io-index)" = "
6475140dfd8655aeb72e1fd4b7a1cc1c202be65d71669476e392fe62532b9edd
"
"checksum redox_syscall 0.1.3
2
(registry+https://github.com/rust-lang/crates.io-index)" = "
ab105df655884ede59d45b7070c8a65002d921461ee813a024558ca16030eea0
"
"checksum rand 0.3.
20
(registry+https://github.com/rust-lang/crates.io-index)" = "
512870020642bb8c221bf68baa1b2573da814f6ccfe5c9699b1c303047abe9b1
"
"checksum redox_syscall 0.1.3
7
(registry+https://github.com/rust-lang/crates.io-index)" = "
0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd
"
"checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
"checksum serde 1.0.2
4
(registry+https://github.com/rust-lang/crates.io-index)" = "
1c57ab4ec5fa85d08aaf8ed9245899d9bbdd66768945b21113b84d5f595cb6a1
"
"checksum serde_derive 1.0.2
4
(registry+https://github.com/rust-lang/crates.io-index)" = "
02c92ea07b6e49b959c1481804ebc9bfd92d3c459f1274c9a9546829e42a66ce
"
"checksum serde_derive_internals 0.1
8
.0 (registry+https://github.com/rust-lang/crates.io-index)" = "
75c6aac7b99801a16db5b40b7bf0d7e4ba16e76fbf231e32a4677f271cac0603
"
"checksum serde 1.0.2
7
(registry+https://github.com/rust-lang/crates.io-index)" = "
db99f3919e20faa51bb2996057f5031d8685019b5a06139b1ce761da671b8526
"
"checksum serde_derive 1.0.2
7
(registry+https://github.com/rust-lang/crates.io-index)" = "
f4ba7591cfe93755e89eeecdbcc668885624829b020050e6aec99c2a03bd3fd0
"
"checksum serde_derive_internals 0.1
9
.0 (registry+https://github.com/rust-lang/crates.io-index)" = "
6e03f1c9530c3fb0a0a5c9b826bdd9246a5921ae995d75f512ac917fc4dd55b5
"
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
"checksum time 0.1.3
8
(registry+https://github.com/rust-lang/crates.io-index)" = "
d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520
"
"checksum time 0.1.3
9
(registry+https://github.com/rust-lang/crates.io-index)" = "
a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098
"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b09fb3b6f248ea4cd42c9a65113a847d612e17505d6ebd1f7357ad68a8bf8693"
"checksum winapi-i686-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ec6667f60c23eca65c561e63a13d81b44234c2e38a6b6c959025ee907ec614cc"
"checksum winapi-x86_64-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98f12c52b2630cd05d2c3ffd8e008f7f48252c042b4871c72aed9dc733b96668"
This diff is collapsed.
Click to expand it.
keys/Cargo.toml
+
1
−
1
View file @
c84ff91c
[package]
name
=
"duniter-keys"
version
=
"0.
1
.0"
version
=
"0.
2
.0"
authors
=
[
"nanocryk <nanocryk@duniter.org>"
]
description
=
"Manage cryptographic keys for the Duniter project."
repository
=
"https://git.duniter.org/nodes/rust/duniter-rs"
...
...
This diff is collapsed.
Click to expand it.
keys/ed25519.rs
+
0
−
20
View file @
c84ff91c
...
...
@@ -31,10 +31,6 @@ use crypto;
use
super
::
BaseConvertionError
;
// ---------------------------- //
// ----- struct Signature ----- //
// ---------------------------- //
/// Store a ed25519 signature.
#[derive(Clone,
Copy)]
pub
struct
Signature
(
pub
[
u8
;
64
]);
...
...
@@ -91,10 +87,6 @@ impl PartialEq<Signature> for Signature {
impl
Eq
for
Signature
{}
// ---------------------------- //
// ----- struct PublicKey ----- //
// ---------------------------- //
/// Store a Ed25519 public key.
///
/// Can be generated with [`KeyPairGenerator`].
...
...
@@ -152,10 +144,6 @@ impl super::PublicKey for PublicKey {
}
}
// ----------------------------- //
// ----- struct PrivateKey ----- //
// ----------------------------- //
/// Store a Ed25519 private key.
///
/// Can be generated with [`KeyPairGenerator`].
...
...
@@ -223,10 +211,6 @@ impl super::PrivateKey for PrivateKey {
}
}
// ----------------------------------- //
// ----- struct KeyPairGenerator ----- //
// ----------------------------------- //
/// Keypair generator with given parameters for `scrypt` keypair function.
#[derive(Debug,
Copy,
Clone)]
pub
struct
KeyPairGenerator
{
...
...
@@ -277,10 +261,6 @@ impl KeyPairGenerator {
}
}
// ---------------------- //
// ----- UNIT TESTS ----- //
// ---------------------- //
#[cfg(test)]
mod
tests
{
use
super
::
*
;
...
...
This diff is collapsed.
Click to expand it.
keys/lib.rs
+
5
−
25
View file @
c84ff91c
// Copyright (C) 201
7
The Duniter Project Developers.
// Copyright (C) 201
8
The Duniter Project Developers.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
...
...
@@ -61,10 +61,6 @@ use base58::ToBase58;
pub
mod
ed25519
;
// ------------------------------------ //
// ----- enum BaseConvertionError ----- //
// ------------------------------------ //
/// Errors enumeration for Base58/64 strings convertion.
#[derive(Clone,
Copy,
Debug,
PartialEq,
Eq)]
pub
enum
BaseConvertionError
{
...
...
@@ -76,10 +72,6 @@ pub enum BaseConvertionError {
InvalidBaseConverterLength
(),
}
// --------------------------- //
// ----- trait Signature ----- //
// --------------------------- //
/// Store a cryptographic signature.
///
/// A signature can be converted from/to Base64 format.
...
...
@@ -104,10 +96,6 @@ pub trait Signature: Clone + Display + Debug + PartialEq + Eq {
fn
to_base64
(
&
self
)
->
String
;
}
// ---------------------------- //
// ----- struct PublicKey ----- //
// ---------------------------- //
/// Store a cryptographic public key.
///
/// A `PublicKey` can be converted from/to Base64 format.
...
...
@@ -118,10 +106,8 @@ pub trait Signature: Clone + Display + Debug + PartialEq + Eq {
///
/// [`PrivateKey`]: trait.PrivateKey.html
pub
trait
PublicKey
:
Clone
+
Display
+
Debug
+
PartialEq
+
Eq
+
ToBase58
{
/// [`Signature`] type of associated cryptosystem.
///
/// [`Signature`]: trait.Signature.html
type
Signature
;
/// Signature type of associated cryptosystem.
type
Signature
:
Signature
;
/// Create a PublicKey from a Base58 string.
///
...
...
@@ -136,10 +122,6 @@ pub trait PublicKey: Clone + Display + Debug + PartialEq + Eq + ToBase58 {
fn
verify
(
&
self
,
message
:
&
[
u8
],
signature
:
&
Self
::
Signature
)
->
bool
;
}
// ----------------------------- //
// ----- struct PrivateKey ----- //
// ----------------------------- //
/// Store a cryptographic private key.
///
/// A `PrivateKey` can be converted from/to Base58 format.
...
...
@@ -150,10 +132,8 @@ pub trait PublicKey: Clone + Display + Debug + PartialEq + Eq + ToBase58 {
///
/// [`PublicKey`]: trait.PublicKey.html
pub
trait
PrivateKey
:
Clone
+
Display
+
Debug
+
PartialEq
+
Eq
+
ToBase58
{
/// [`Signature`] type of associated cryptosystem.
///
/// [`Signature`]: trait.Signature.html
type
Signature
;
/// Signature type of associated cryptosystem.
type
Signature
:
Signature
;
/// Create a PrivateKey from a Base58 string.
///
...
...
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