Skip to content

Commit 5e07e75

Browse files
committed
Add period to sentences
Add the terminating period to all docs sentences. (Also one instance of capitialize initial character in sentence.)
1 parent 269bde0 commit 5e07e75

File tree

6 files changed

+43
-44
lines changed

6 files changed

+43
-44
lines changed

src/constants.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//
1515

1616
//! # Constants
17-
//! Constants related to the API and the underlying curve
17+
//! Constants related to the API and the underlying curve.
1818
1919
/// The size (in bytes) of a message
2020
pub const MESSAGE_SIZE: usize = 32;
@@ -51,23 +51,23 @@ pub const FIELD_SIZE: [u8; 32] = [
5151
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2f
5252
];
5353

54-
/// The order of the secp256k1 curve
54+
/// The order of the secp256k1 curve.
5555
pub const CURVE_ORDER: [u8; 32] = [
5656
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
5757
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
5858
0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,
5959
0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41
6060
];
6161

62-
/// The X coordinate of the generator
62+
/// The X coordinate of the generator.
6363
pub const GENERATOR_X: [u8; 32] = [
6464
0x79, 0xbe, 0x66, 0x7e, 0xf9, 0xdc, 0xbb, 0xac,
6565
0x55, 0xa0, 0x62, 0x95, 0xce, 0x87, 0x0b, 0x07,
6666
0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xce, 0x28, 0xd9,
6767
0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8, 0x17, 0x98
6868
];
6969

70-
/// The Y coordinate of the generator
70+
/// The Y coordinate of the generator.
7171
pub const GENERATOR_Y: [u8; 32] = [
7272
0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65,
7373
0x5d, 0xa4, 0xfb, 0xfc, 0x0e, 0x11, 0x08, 0xa8,

src/context.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub use self::alloc_only::*;
1111

1212
#[cfg(all(feature = "global-context", feature = "std"))]
1313
#[cfg_attr(docsrs, doc(cfg(all(feature = "global-context", feature = "std"))))]
14-
/// Module implementing a singleton pattern for a global `Secp256k1` context
14+
/// Module implementing a singleton pattern for a global `Secp256k1` context.
1515
pub mod global {
1616
#[cfg(feature = "rand-std")]
1717
use rand;
@@ -20,7 +20,7 @@ pub mod global {
2020
use std::sync::Once;
2121
use {Secp256k1, All};
2222

23-
/// Proxy struct for global `SECP256K1` context
23+
/// Proxy struct for global `SECP256K1` context.
2424
#[derive(Debug, Copy, Clone)]
2525
pub struct GlobalContext {
2626
__private: (),
@@ -98,8 +98,8 @@ pub struct AllPreallocated<'buf> {
9898
mod private {
9999
use super::*;
100100
// A trick to prevent users from implementing a trait.
101-
// on one hand this trait is public, on the other it's in a private module
102-
// so it's not visible to anyone besides it's parent (the context module)
101+
// On one hand this trait is public, on the other it's in a private module
102+
// so it's not visible to anyone besides it's parent (the context module).
103103
pub trait Sealed {}
104104

105105
impl<'buf> Sealed for AllPreallocated<'buf> {}
@@ -289,7 +289,7 @@ unsafe impl<'buf> Context for VerifyOnlyPreallocated<'buf> {
289289
const DESCRIPTION: &'static str = "verification only";
290290

291291
unsafe fn deallocate(_ptr: *mut u8, _size: usize) {
292-
// Allocated by the user
292+
// Allocated by the user.
293293
}
294294
}
295295

@@ -298,7 +298,7 @@ unsafe impl<'buf> Context for AllPreallocated<'buf> {
298298
const DESCRIPTION: &'static str = "all capabilities";
299299

300300
unsafe fn deallocate(_ptr: *mut u8, _size: usize) {
301-
// Allocated by the user
301+
// Allocated by the user.
302302
}
303303
}
304304

@@ -328,7 +328,7 @@ impl<'buf> Secp256k1<AllPreallocated<'buf>> {
328328
pub fn preallocated_new(buf: &'buf mut [AlignedType]) -> Result<Secp256k1<AllPreallocated<'buf>>, Error> {
329329
Secp256k1::preallocated_gen_new(buf)
330330
}
331-
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for a context
331+
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for a context.
332332
pub fn preallocate_size() -> usize {
333333
Self::preallocate_size_gen()
334334
}
@@ -354,12 +354,12 @@ impl<'buf> Secp256k1<AllPreallocated<'buf>> {
354354
}
355355

356356
impl<'buf> Secp256k1<SignOnlyPreallocated<'buf>> {
357-
/// Creates a new Secp256k1 context that can only be used for signing
357+
/// Creates a new Secp256k1 context that can only be used for signing.
358358
pub fn preallocated_signing_only(buf: &'buf mut [AlignedType]) -> Result<Secp256k1<SignOnlyPreallocated<'buf>>, Error> {
359359
Secp256k1::preallocated_gen_new(buf)
360360
}
361361

362-
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for the context
362+
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for the context.
363363
#[inline]
364364
pub fn preallocate_signing_size() -> usize {
365365
Self::preallocate_size_gen()
@@ -374,7 +374,7 @@ impl<'buf> Secp256k1<SignOnlyPreallocated<'buf>> {
374374
/// * The capabilities (All/SignOnly/VerifyOnly) of the context *must* match the flags passed to libsecp256k1
375375
/// when generating the context.
376376
/// * The user must handle the freeing of the context(using the correct functions) by himself.
377-
/// * This list *is not* exhaustive, and any violation may lead to Undefined Behavior.,
377+
/// * This list *is not* exhaustive, and any violation may lead to Undefined Behavior.
378378
///
379379
pub unsafe fn from_raw_signining_only(raw_ctx: *mut ffi::Context) -> ManuallyDrop<Secp256k1<SignOnlyPreallocated<'buf>>> {
380380
ManuallyDrop::new(Secp256k1 {
@@ -391,7 +391,7 @@ impl<'buf> Secp256k1<VerifyOnlyPreallocated<'buf>> {
391391
Secp256k1::preallocated_gen_new(buf)
392392
}
393393

394-
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for the context
394+
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for the context.
395395
#[inline]
396396
pub fn preallocate_verification_size() -> usize {
397397
Self::preallocate_size_gen()
@@ -406,7 +406,7 @@ impl<'buf> Secp256k1<VerifyOnlyPreallocated<'buf>> {
406406
/// * The capabilities (All/SignOnly/VerifyOnly) of the context *must* match the flags passed to libsecp256k1
407407
/// when generating the context.
408408
/// * The user must handle the freeing of the context(using the correct functions) by himself.
409-
/// * This list *is not* exhaustive, and any violation may lead to Undefined Behavior.,
409+
/// * This list *is not* exhaustive, and any violation may lead to Undefined Behavior.
410410
///
411411
pub unsafe fn from_raw_verification_only(raw_ctx: *mut ffi::Context) -> ManuallyDrop<Secp256k1<VerifyOnlyPreallocated<'buf>>> {
412412
ManuallyDrop::new(Secp256k1 {

src/ecdh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//
1414

1515
//! # ECDH
16-
//! Support for shared secret computations
16+
//! Support for shared secret computations.
1717
//!
1818
1919
use core::ptr;

src/ecdsa/recovery.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ use ffi::recovery as ffi;
2525
use super::*;
2626
use {Verification, Secp256k1, Signing, Message};
2727

28-
/// A tag used for recovering the public key from a compact signature
28+
/// A tag used for recovering the public key from a compact signature.
2929
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
3030
pub struct RecoveryId(i32);
3131

32-
/// An ECDSA signature with a recovery ID for pubkey recovery
32+
/// An ECDSA signature with a recovery ID for pubkey recovery.
3333
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
3434
pub struct RecoverableSignature(ffi::RecoverableSignature);
3535

@@ -53,8 +53,7 @@ pub fn to_i32(self) -> i32 {
5353
impl RecoverableSignature {
5454
#[inline]
5555
/// Converts a compact-encoded byte slice to a signature. This
56-
/// representation is nonstandard and defined by the libsecp256k1
57-
/// library.
56+
/// representation is nonstandard and defined by the libsecp256k1 library.
5857
pub fn from_compact(data: &[u8], recid: RecoveryId) -> Result<RecoverableSignature, Error> {
5958
if data.is_empty() {return Err(Error::InvalidSignature);}
6059

@@ -77,20 +76,20 @@ impl RecoverableSignature {
7776
}
7877
}
7978

80-
/// Obtains a raw pointer suitable for use with FFI functions
79+
/// Obtains a raw pointer suitable for use with FFI functions.
8180
#[inline]
8281
pub fn as_ptr(&self) -> *const ffi::RecoverableSignature {
8382
&self.0
8483
}
8584

86-
/// Obtains a raw mutable pointer suitable for use with FFI functions
85+
/// Obtains a raw mutable pointer suitable for use with FFI functions.
8786
#[inline]
8887
pub fn as_mut_ptr(&mut self) -> *mut ffi::RecoverableSignature {
8988
&mut self.0
9089
}
9190

9291
#[inline]
93-
/// Serializes the recoverable signature in compact format
92+
/// Serializes the recoverable signature in compact format.
9493
pub fn serialize_compact(&self) -> (RecoveryId, [u8; 64]) {
9594
let mut ret = [0u8; 64];
9695
let mut recid = 0i32;
@@ -107,7 +106,7 @@ impl RecoverableSignature {
107106
}
108107

109108
/// Converts a recoverable signature to a non-recoverable one (this is needed
110-
/// for verification
109+
/// for verification).
111110
#[inline]
112111
pub fn to_standard(&self) -> Signature {
113112
unsafe {
@@ -135,7 +134,7 @@ impl CPtr for RecoverableSignature {
135134
}
136135
}
137136

138-
/// Creates a new recoverable signature from a FFI one
137+
/// Creates a new recoverable signature from a FFI one.
139138
impl From<ffi::RecoverableSignature> for RecoverableSignature {
140139
#[inline]
141140
fn from(sig: ffi::RecoverableSignature) -> RecoverableSignature {
@@ -144,7 +143,7 @@ impl From<ffi::RecoverableSignature> for RecoverableSignature {
144143
}
145144

146145
impl<C: Signing> Secp256k1<C> {
147-
/// Constructs a signature for `msg` using the secret key `sk` and RFC6979 nonce
146+
/// Constructs a signature for `msg` using the secret key `sk` and RFC6979 nonce.
148147
/// Requires a signing-capable context.
149148
#[deprecated(since = "0.21.0", note = "Use sign_ecdsa_recoverable instead.")]
150149
pub fn sign_recoverable(&self, msg: &Message, sk: &key::SecretKey) -> RecoverableSignature {

src/key.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl str::FromStr for SecretKey {
5757
}
5858
}
5959

60-
/// The number 1 encoded as a secret key
60+
/// The number 1 encoded as a secret key.
6161
pub const ONE_KEY: SecretKey = SecretKey([0, 0, 0, 0, 0, 0, 0, 0,
6262
0, 0, 0, 0, 0, 0, 0, 0,
6363
0, 0, 0, 0, 0, 0, 0, 0,
@@ -344,7 +344,7 @@ impl PublicKey {
344344
unsafe {
345345
let mut pk = ffi::PublicKey::new();
346346
// We can assume the return value because it's not possible to construct
347-
// an invalid `SecretKey` without transmute trickery or something
347+
// an invalid `SecretKey` without transmute trickery or something.
348348
let res = ffi::secp256k1_ec_pubkey_create(secp.ctx, &mut pk, sk.as_c_ptr());
349349
debug_assert_eq!(res, 1);
350350
PublicKey(pk)

src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub use context::global::SECP256K1;
205205
use hashes::Hash;
206206

207207
// Backwards compatible changes
208-
/// Schnorr Sig related methods
208+
/// Schnorr Signature related methods.
209209
#[deprecated(since = "0.21.0", note = "Use schnorr instead.")]
210210
pub mod schnorrsig {
211211
#[deprecated(since = "0.21.0", note = "Use crate::XOnlyPublicKey instead.")]
@@ -255,7 +255,7 @@ impl<T: hashes::sha256t::Tag> ThirtyTwoByteHash for hashes::sha256t::Hash<T> {
255255
}
256256
}
257257

258-
/// A (hashed) message input to an ECDSA signature
258+
/// A (hashed) message input to an ECDSA signature.
259259
pub struct Message([u8; constants::MESSAGE_SIZE]);
260260
impl_array_newtype!(Message, u8, constants::MESSAGE_SIZE);
261261
impl_pretty_debug!(Message);
@@ -302,7 +302,7 @@ impl Message {
302302
}
303303

304304
impl<T: ThirtyTwoByteHash> From<T> for Message {
305-
/// Converts a 32-byte hash directly to a message without error paths
305+
/// Converts a 32-byte hash directly to a message without error paths.
306306
fn from(t: T) -> Message {
307307
Message(t.into_32())
308308
}
@@ -314,21 +314,21 @@ pub enum Error {
314314
/// Signature failed verification
315315
IncorrectSignature,
316316
/// Badly sized message ("messages" are actually fixed-sized digests; see the `MESSAGE_SIZE`
317-
/// constant)
317+
/// constant).
318318
InvalidMessage,
319-
/// Bad public key
319+
/// Bad public key.
320320
InvalidPublicKey,
321-
/// Bad signature
321+
/// Bad signature.
322322
InvalidSignature,
323-
/// Bad secret key
323+
/// Bad secret key.
324324
InvalidSecretKey,
325-
/// Bad recovery id
325+
/// Bad recovery id.
326326
InvalidRecoveryId,
327327
/// Invalid tweak for add_*_assign or mul_*_assign
328328
InvalidTweak,
329-
/// Didn't pass enough memory to context creation with preallocated memory
329+
/// Didn't pass enough memory to context creation with preallocated memory.
330330
NotEnoughMemory,
331-
/// Bad set of public keys
331+
/// Bad set of public keys.
332332
InvalidPublicKeySum,
333333
/// The only valid parity values are 0 or 1.
334334
InvalidParityValue,
@@ -351,7 +351,7 @@ impl Error {
351351
}
352352
}
353353

354-
// Passthrough Debug to Display, since errors should be user-visible
354+
// Passthrough Debug to Display, since errors should be user-visible.
355355
impl fmt::Display for Error {
356356
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
357357
f.write_str(self.as_str())
@@ -363,16 +363,16 @@ impl fmt::Display for Error {
363363
impl std::error::Error for Error {}
364364

365365

366-
/// The secp256k1 engine, used to execute all signature operations
366+
/// The secp256k1 engine, used to execute all signature operations.
367367
pub struct Secp256k1<C: Context> {
368368
ctx: *mut ffi::Context,
369369
phantom: PhantomData<C>,
370370
size: usize,
371371
}
372372

373-
// The underlying secp context does not contain any references to memory it does not own
373+
// The underlying secp context does not contain any references to memory it does not own.
374374
unsafe impl<C: Context> Send for Secp256k1<C> {}
375-
// The API does not permit any mutation of `Secp256k1` objects except through `&mut` references
375+
// The API does not permit any mutation of `Secp256k1` objects except through `&mut` references.
376376
unsafe impl<C: Context> Sync for Secp256k1<C> {}
377377

378378
impl<C: Context> PartialEq for Secp256k1<C> {
@@ -406,7 +406,7 @@ impl<C: Context> Secp256k1<C> {
406406
&self.ctx
407407
}
408408

409-
/// Returns the required memory for a preallocated context buffer in a generic manner(sign/verify/all)
409+
/// Returns the required memory for a preallocated context buffer in a generic manner(sign/verify/all).
410410
pub fn preallocate_size_gen() -> usize {
411411
let word_size = mem::size_of::<AlignedType>();
412412
let bytes = unsafe { ffi::secp256k1_context_preallocated_size(C::FLAGS) };

0 commit comments

Comments
 (0)