Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/aead/aes_gcm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ pub(super) const MAX_IN_OUT_LEN: usize = super::max_input_len(BLOCK_LEN, 2);
//
// [NIST SP800-38D]:
// http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
// [RFC 5116 Section 5.1]: https://tools.ietf.org/html/rfc5116#section-5.1
// [RFC 5116 Section 5.2]: https://tools.ietf.org/html/rfc5116#section-5.2
// [RFC 5116 Section 5.1]: https://www.rfc-editor.org/rfc/rfc5116#section-5.1
// [RFC 5116 Section 5.2]: https://www.rfc-editor.org/rfc/rfc5116#section-5.2
const _MAX_INPUT_LEN_BOUNDED_BY_NIST: () =
assert!(MAX_IN_OUT_LEN == usize_from_u64_saturated(((1u64 << 39) - 256) / 8));

Expand Down
2 changes: 1 addition & 1 deletion src/aead/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub(super) fn aes_gcm_open<'o>(
///
/// The keys are 256 bits long and the nonces are 96 bits long.
///
/// [RFC 8439]: https://tools.ietf.org/html/rfc8439
/// [RFC 8439]: https://www.rfc-editor.org/rfc/rfc8439
pub static CHACHA20_POLY1305: Algorithm = Algorithm {
key_len: chacha20_poly1305::KEY_LEN,
init: chacha20_poly1305_init,
Expand Down
2 changes: 1 addition & 1 deletion src/aead/chacha20_poly1305/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cfg_if! {
pub(super) const KEY_LEN: usize = chacha::KEY_LEN;

const MAX_IN_OUT_LEN: usize = super::max_input_len(64, 1);
// https://tools.ietf.org/html/rfc8439#section-2.8
// https://www.rfc-editor.org/rfc/rfc8439#section-2.8
const _MAX_IN_OUT_LEN_BOUNDED_BY_RFC: () =
assert!(MAX_IN_OUT_LEN == usize_from_u64_saturated(274_877_906_880u64));

Expand Down
2 changes: 1 addition & 1 deletion src/aead/chacha20_poly1305_openssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//!
//! [chacha20-poly1305@openssh.com]:
//! http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.chacha20poly1305?annotate=HEAD
//! [RFC 4253]: https://tools.ietf.org/html/rfc4253
//! [RFC 4253]: https://www.rfc-editor.org/rfc/rfc4253

#[allow(unused_imports)]
use crate::polyfill::prelude::*;
Expand Down
4 changes: 2 additions & 2 deletions src/ec/curve25519/ed25519/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ impl Ed25519KeyPair {
/// as described in [RFC 5958 Section 2]; see [RFC 8410 Section 10.3] for an
/// example.
///
/// [RFC 5958 Section 2]: https://tools.ietf.org/html/rfc5958#section-2
/// [RFC 8410 Section 10.3]: https://tools.ietf.org/html/rfc8410#section-10.3
/// [RFC 5958 Section 2]: https://www.rfc-editor.org/rfc/rfc5958#section-2
/// [RFC 8410 Section 10.3]: https://www.rfc-editor.org/rfc/rfc8410#section-10.3
pub fn generate_pkcs8(
rng: &dyn rand::SecureRandom,
) -> Result<pkcs8::Document, error::Unspecified> {
Expand Down
2 changes: 1 addition & 1 deletion src/ec/curve25519/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Elem<Tight> {
}
}

// [RFC 8032] https://tools.ietf.org/html/rfc8032#section-5.1.2
// [RFC 8032] https://www.rfc-editor.org/rfc/rfc8032#section-5.1.2
// This is *NOT* the type to use for X25519 output.
#[derive(Clone, Copy)]
#[repr(transparent)]
Expand Down
6 changes: 3 additions & 3 deletions src/ec/curve25519/x25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ static CURVE25519: ec::Curve = ec::Curve {
/// result of the X25519 operation is zero; see the notes on the
/// "all-zero value" in [RFC 7748 section 6.1].
///
/// [RFC 7748]: https://tools.ietf.org/html/rfc7748
/// [RFC 7748 section 6.1]: https://tools.ietf.org/html/rfc7748#section-6.1
/// [RFC 7748]: https://www.rfc-editor.org/rfc/rfc7748
/// [RFC 7748 section 6.1]: https://www.rfc-editor.org/rfc/rfc7748#section-6.1
pub static X25519: agreement::Algorithm = agreement::Algorithm {
curve: &CURVE25519,
ecdh: x25519_ecdh,
Expand All @@ -59,7 +59,7 @@ fn x25519_generate_private_key(
rng.fill(out)
}

// https://tools.ietf.org/html/rfc7748#section-5
// https://www.rfc-editor.org/rfc/rfc7748#section-5
type UCoordinate = [u8; PUBLIC_KEY_LEN];

fn x25519_public_from_private(
Expand Down
4 changes: 2 additions & 2 deletions src/ec/suite_b/ecdsa/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ impl EcdsaKeyPair {
/// not have a `parameters` field so the generated key is compatible with
/// PKCS#11.
///
/// [RFC 5915]: https://tools.ietf.org/html/rfc5915
/// [RFC 5958 Section 2]: https://tools.ietf.org/html/rfc5958#section-2
/// [RFC 5915]: https://www.rfc-editor.org/rfc/rfc5915
/// [RFC 5958 Section 2]: https://www.rfc-editor.org/rfc/rfc5958#section-2
pub fn generate_pkcs8(
alg: &'static EcdsaSigningAlgorithm,
rng: &dyn rand::SecureRandom,
Expand Down
2 changes: 1 addition & 1 deletion src/ec/suite_b/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ pub(crate) fn key_pair_from_pkcs8(
let (ec_private_key, _) = pkcs8::unwrap_key(template, pkcs8::Version::V1Only, input)?;
let (private_key, public_key) =
ec_private_key.read_all(error::KeyRejected::invalid_encoding(), |input| {
// https://tools.ietf.org/html/rfc5915#section-3
// https://www.rfc-editor.org/rfc/rfc5915#section-3
der::nested(
input,
der::Tag::Sequence,
Expand Down
6 changes: 3 additions & 3 deletions src/hkdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//!
//! HKDF is specified in [RFC 5869].
//!
//! [RFC 5869]: https://tools.ietf.org/html/rfc5869
//! [RFC 5869]: https://www.rfc-editor.org/rfc/rfc5869

use crate::{error, hmac};

Expand Down Expand Up @@ -67,7 +67,7 @@ impl Salt {

/// The [HKDF-Extract] operation.
///
/// [HKDF-Extract]: https://tools.ietf.org/html/rfc5869#section-2.2
/// [HKDF-Extract]: https://www.rfc-editor.org/rfc/rfc5869#section-2.2
pub fn extract(&self, secret: &[u8]) -> Prk {
// The spec says that if no salt is provided then a key of
// `digest_alg.output_len` bytes of zeros is used. But, HMAC keys are
Expand Down Expand Up @@ -120,7 +120,7 @@ impl Prk {

/// The [HKDF-Expand] operation.
///
/// [HKDF-Expand]: https://tools.ietf.org/html/rfc5869#section-2.3
/// [HKDF-Expand]: https://www.rfc-editor.org/rfc/rfc5869#section-2.3
///
/// Fails if (and only if) `len` is too large.
#[inline]
Expand Down
4 changes: 2 additions & 2 deletions src/hmac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
//! # Ok::<(), ring::error::Unspecified>(())
//! ```
//!
//! [RFC 2104]: https://tools.ietf.org/html/rfc2104
//! [RFC 2104]: https://www.rfc-editor.org/rfc/rfc2104

use crate::{
bb, cpu,
Expand Down Expand Up @@ -174,7 +174,7 @@ impl Key {
/// The key will be `digest_alg.output_len` bytes long, based on the
/// recommendation in [RFC 2104 Section 3].
///
/// [RFC 2104 Section 3]: https://tools.ietf.org/html/rfc2104#section-3
/// [RFC 2104 Section 3]: https://www.rfc-editor.org/rfc/rfc2104#section-3
pub fn generate(
algorithm: Algorithm,
rng: &dyn rand::SecureRandom,
Expand Down
4 changes: 2 additions & 2 deletions src/pbkdf2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
//! PBKDF2 is specified in [RFC 2898 Section 5.2] with test vectors given in
//! [RFC 6070]. See also [NIST Special Publication 800-132].
//!
//! [RFC 2898 Section 5.2]: https://tools.ietf.org/html/rfc2898#section-5.2
//! [RFC 6070]: https://tools.ietf.org/html/rfc6070
//! [RFC 2898 Section 5.2]: https://www.rfc-editor.org/rfc/rfc2898#section-5.2
//! [RFC 6070]: https://www.rfc-editor.org/rfc/rfc6070
//! [NIST Special Publication 800-132]:
//! http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf
//!
Expand Down
6 changes: 3 additions & 3 deletions src/pkcs8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

//! PKCS#8 is specified in [RFC 5958].
//!
//! [RFC 5958]: https://tools.ietf.org/html/rfc5958
//! [RFC 5958]: https://www.rfc-editor.org/rfc/rfc5958

use crate::{ec, error, io::der};

Expand Down Expand Up @@ -72,7 +72,7 @@ impl Template {
///
/// PKCS#8 is specified in [RFC 5958].
///
/// [RFC 5958]: https://tools.ietf.org/html/rfc5958
/// [RFC 5958]: https://www.rfc-editor.org/rfc/rfc5958
pub(crate) fn unwrap_key<'a>(
template: &Template,
version: Version,
Expand All @@ -90,7 +90,7 @@ pub(crate) fn unwrap_key<'a>(
///
/// PKCS#8 is specified in [RFC 5958].
///
/// [RFC 5958]: https://tools.ietf.org/html/rfc5958
/// [RFC 5958]: https://www.rfc-editor.org/rfc/rfc5958
pub(crate) fn unwrap_key_<'a>(
alg_id: untrusted::Input,
version: Version,
Expand Down
6 changes: 3 additions & 3 deletions src/rsa/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ impl KeyPair {
/// http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Br1.pdf
///
/// [RFC 3447 Appendix A.1.2]:
/// https://tools.ietf.org/html/rfc3447#appendix-A.1.2
/// https://www.rfc-editor.org/rfc/rfc3447#appendix-A.1.2
///
/// [RFC 5958]:
/// https://tools.ietf.org/html/rfc5958
/// https://www.rfc-editor.org/rfc/rfc5958
pub fn from_pkcs8(pkcs8: &[u8]) -> Result<Self, KeyRejected> {
const RSA_ENCRYPTION: &[u8] = include_bytes!("../data/alg-rsa-encryption.der");
let (der, _) = pkcs8::unwrap_key_(
Expand All @@ -120,7 +120,7 @@ impl KeyPair {
/// validated.
///
/// [RFC 3447 Appendix A.1.2]:
/// https://tools.ietf.org/html/rfc3447#appendix-A.1.2
/// https://www.rfc-editor.org/rfc/rfc3447#appendix-A.1.2
///
/// [NIST SP-800-56B rev. 1]:
/// http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Br1.pdf
Expand Down
6 changes: 3 additions & 3 deletions src/rsa/padding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(super) fn encode(

/// An RSA signature encoding as described in [RFC 3447 Section 8].
///
/// [RFC 3447 Section 8]: https://tools.ietf.org/html/rfc3447#section-8
/// [RFC 3447 Section 8]: https://www.rfc-editor.org/rfc/rfc3447#section-8
#[cfg(feature = "alloc")]
pub trait RsaEncoding: Padding {
#[doc(hidden)]
Expand Down Expand Up @@ -78,7 +78,7 @@ pub trait RsaEncoding: Padding {
/// Verification of an RSA signature encoding as described in
/// [RFC 3447 Section 8].
///
/// [RFC 3447 Section 8]: https://tools.ietf.org/html/rfc3447#section-8
/// [RFC 3447 Section 8]: https://www.rfc-editor.org/rfc/rfc3447#section-8
pub trait Verification: Padding {
fn verify(
&self,
Expand All @@ -89,7 +89,7 @@ pub trait Verification: Padding {
}

// Masks `out` with the output of the mask-generating function MGF1 as
// described in https://tools.ietf.org/html/rfc3447#appendix-B.2.1.
// described in https://www.rfc-editor.org/rfc/rfc3447#appendix-B.2.1.
fn mgf1(digest_alg: &'static digest::Algorithm, seed: &[u8], out: &mut [u8]) {
let digest_len = digest_alg.output_len();

Expand Down
4 changes: 2 additions & 2 deletions src/rsa/padding/pkcs1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{bits, digest, error, io::der, rand, sealed};
/// See "`RSA_PSS_*` Details\" in `ring::signature`'s module-level
/// documentation for more details.
///
/// [RFC 3447 Section 8.2]: https://tools.ietf.org/html/rfc3447#section-8.2
/// [RFC 3447 Section 8.2]: https://www.rfc-editor.org/rfc/rfc3447#section-8.2
#[derive(Debug)]
pub struct PKCS1 {
digest_alg: &'static digest::Algorithm,
Expand Down Expand Up @@ -67,7 +67,7 @@ impl Verification for PKCS1 {
}

// Implement padding procedure per EMSA-PKCS1-v1_5,
// https://tools.ietf.org/html/rfc3447#section-9.2. This is used by both
// https://www.rfc-editor.org/rfc/rfc3447#section-9.2. This is used by both
// verification and signing so it needs to be able to handle moduli of the
// minimum and maximum sizes for both operations.
fn pkcs1_encode(pkcs1: &PKCS1, m_hash: digest::Digest, m_out: &mut [u8]) {
Expand Down
8 changes: 4 additions & 4 deletions src/rsa/padding/pss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{bb, bits, digest, error, rand, sealed};
/// See "`RSA_PSS_*` Details\" in `ring::signature`'s module-level
/// documentation for more details.
///
/// [RFC 3447 Section 8.1]: https://tools.ietf.org/html/rfc3447#section-8.1
/// [RFC 3447 Section 8.1]: https://www.rfc-editor.org/rfc/rfc3447#section-8.1
#[allow(clippy::upper_case_acronyms)] // TODO: Until we implement cargo-semver-checks
#[derive(Debug)]
pub struct PSS {
Expand All @@ -35,7 +35,7 @@ impl Padding for PSS {

impl RsaEncoding for PSS {
// Implement padding procedure per EMSA-PSS,
// https://tools.ietf.org/html/rfc3447#section-9.1.
// https://www.rfc-editor.org/rfc/rfc3447#section-9.1.
fn encode_(
&self,
m_hash: digest::Digest,
Expand Down Expand Up @@ -99,7 +99,7 @@ impl RsaEncoding for PSS {
}

impl Verification for PSS {
// RSASSA-PSS-VERIFY from https://tools.ietf.org/html/rfc3447#section-8.1.2
// RSASSA-PSS-VERIFY from https://www.rfc-editor.org/rfc/rfc3447#section-8.1.2
// where steps 1, 2(a), and 2(b) have been done for us.
fn verify(
&self,
Expand All @@ -126,7 +126,7 @@ impl Verification for PSS {
let em = m;

// The rest of this function is EMSA-PSS-VERIFY from
// https://tools.ietf.org/html/rfc3447#section-9.1.2.
// https://www.rfc-editor.org/rfc/rfc3447#section-9.1.2.

// Steps 1 and 2 are done by the caller to produce `m_hash`.

Expand Down
8 changes: 4 additions & 4 deletions src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@
//! [Suite B implementer's guide to FIPS 186-3]:
//! https://github.com/briansmith/ring/blob/main/doc/ecdsa.pdf
//! [RFC 3279 Section 2.2.3]:
//! https://tools.ietf.org/html/rfc3279#section-2.2.3
//! https://www.rfc-editor.org/rfc/rfc3279#section-2.2.3
//! [RFC 3447 Section 8.2]:
//! https://tools.ietf.org/html/rfc3447#section-7.2
//! https://www.rfc-editor.org/rfc/rfc3447#section-7.2
//! [RFC 3447 Section 8.1]:
//! https://tools.ietf.org/html/rfc3447#section-8.1
//! https://www.rfc-editor.org/rfc/rfc3447#section-8.1
//! [RFC 3447 Appendix-A.1.1]:
//! https://tools.ietf.org/html/rfc3447#appendix-A.1.1
//! https://www.rfc-editor.org/rfc/rfc3447#appendix-A.1.1
//!
//!
//! # Examples
Expand Down