@@ -54,35 +54,35 @@ impl_from_array_len!(SharedSecret, 256, (16 20 28 32 48 64 96 128 256));
54
54
55
55
impl SharedSecret {
56
56
57
- /// Create an empty SharedSecret
57
+ /// Creates an empty ` SharedSecret`.
58
58
pub ( crate ) fn empty ( ) -> SharedSecret {
59
59
SharedSecret {
60
60
data : [ 0u8 ; 256 ] ,
61
61
len : 0 ,
62
62
}
63
63
}
64
64
65
- /// Get a pointer to the underlying data with the specified capacity.
65
+ /// Gets a pointer to the underlying data with the specified capacity.
66
66
pub ( crate ) fn get_data_mut_ptr ( & mut self ) -> * mut u8 {
67
67
self . data . as_mut_ptr ( )
68
68
}
69
69
70
- /// Get the capacity of the underlying data buffer.
70
+ /// Gets the capacity of the underlying data buffer.
71
71
pub fn capacity ( & self ) -> usize {
72
72
self . data . len ( )
73
73
}
74
74
75
- /// Get the len of the used data.
75
+ /// Gets the len of the used data.
76
76
pub fn len ( & self ) -> usize {
77
77
self . len
78
78
}
79
79
80
- /// True if the underlying data buffer is empty.
80
+ /// Returns true if the underlying data buffer is empty.
81
81
pub fn is_empty ( & self ) -> bool {
82
82
self . data . is_empty ( )
83
83
}
84
84
85
- /// Set the length of the object.
85
+ /// Sets the length of the object.
86
86
pub ( crate ) fn set_len ( & mut self , len : usize ) {
87
87
debug_assert ! ( len <= self . data. len( ) ) ;
88
88
self . len = len;
@@ -116,7 +116,7 @@ unsafe extern "C" fn c_callback(output: *mut c_uchar, x: *const c_uchar, y: *con
116
116
}
117
117
118
118
impl SharedSecret {
119
- /// Creates a new shared secret from a pubkey and secret key
119
+ /// Creates a new shared secret from a pubkey and secret key.
120
120
#[ inline]
121
121
pub fn new ( point : & PublicKey , scalar : & SecretKey ) -> SharedSecret {
122
122
let mut ss = SharedSecret :: empty ( ) ;
@@ -138,7 +138,7 @@ impl SharedSecret {
138
138
}
139
139
140
140
141
- /// Creates a new shared secret from a pubkey and secret key with applied custom hash function
141
+ /// Creates a new shared secret from a pubkey and secret key with applied custom hash function.
142
142
/// The custom hash function must be in the form of `fn(x: [u8;32], y: [u8;32]) -> SharedSecret`
143
143
/// `SharedSecret` can be easily created via the `From` impl from arrays.
144
144
/// # Examples
0 commit comments