1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2018 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

use rust_sodium::crypto::box_::{
    NONCEBYTES as ASYM_NONCE_LEN, PUBLICKEYBYTES as ASYM_PUBLIC_KEY_LEN,
    SECRETKEYBYTES as ASYM_SECRET_KEY_LEN,
};
use rust_sodium::crypto::secretbox::{KEYBYTES as SYM_KEY_LEN, NONCEBYTES as SYM_NONCE_LEN};
use rust_sodium::crypto::sign::{
    PUBLICKEYBYTES as SIGN_PUBLIC_KEY_LEN, SECRETKEYBYTES as SIGN_SECRET_KEY_LEN,
};
use safe_nd::XOR_NAME_LEN;

/// Array containing public key bytes.
pub type AsymPublicKey = [u8; ASYM_PUBLIC_KEY_LEN];
/// Array containing private key bytes.
pub type AsymSecretKey = [u8; ASYM_SECRET_KEY_LEN];
/// Array containing nonce bytes.
pub type AsymNonce = [u8; ASYM_NONCE_LEN];

/// Array containing private key bytes.
pub type SymSecretKey = [u8; SYM_KEY_LEN];
/// Array containing nonce bytes.
pub type SymNonce = [u8; SYM_NONCE_LEN];

/// Array containing BLS public key.
pub type BlsPublicKey = [u8; threshold_crypto::PK_SIZE];

/// Array containing sign public key bytes.
pub type SignPublicKey = [u8; SIGN_PUBLIC_KEY_LEN];
/// Array containing sign private key bytes.
pub type SignSecretKey = [u8; SIGN_SECRET_KEY_LEN];

/// Array containing `XorName` bytes.
pub type XorNameArray = [u8; XOR_NAME_LEN];