Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
getrandom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
getrandom
Commits
6aba12cc
Commit
6aba12cc
authored
4 years ago
by
Joe Richey
Committed by
Joseph Richey
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rename "cpu" feature to "rdrand"
Signed-off-by:
Joe Richey
<
joerichey@google.com
>
parent
618593ca
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.travis.yml
+2
-2
2 additions, 2 deletions
.travis.yml
Cargo.toml
+2
-2
2 additions, 2 deletions
Cargo.toml
src/lib.rs
+2
-2
2 additions, 2 deletions
src/lib.rs
src/test_rdrand.rs
+1
-1
1 addition, 1 deletion
src/test_rdrand.rs
with
7 additions
and
7 deletions
.travis.yml
+
2
−
2
View file @
6aba12cc
...
...
@@ -145,11 +145,11 @@ jobs:
script
:
# We test that getrandom builds for all targets
-
echo $STD_TARGETS | xargs -t -n1 cargo build --target
-
echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=
cpu
--target
-
echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=
rdrand
--target
# also test minimum dependency versions are usable
-
cargo generate-lockfile -Z minimal-versions
-
echo $STD_TARGETS | xargs -t -n1 cargo build --target
-
echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=
cpu
--target
-
echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=
rdrand
--target
# Trust cross-built/emulated targets. We must repeat all non-default values.
-
name
:
"
Linux
(MIPS,
big-endian)"
...
...
This diff is collapsed.
Click to expand it.
Cargo.toml
+
2
−
2
View file @
6aba12cc
...
...
@@ -35,8 +35,8 @@ wasi = "0.9"
[features]
std
=
[]
# Feature to enable fallback
CPU
-based implementation
cpu
=
[]
# Feature to enable fallback
RDRAND
-based implementation
rdrand
=
[]
# Feature to enable custom RNG implementations
custom
=
[]
# Unstable feature to support being a libstd dependency
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
2
−
2
View file @
6aba12cc
...
...
@@ -183,7 +183,7 @@ cfg_if! {
#[path
=
"windows.rs"
]
mod
imp
;
}
else
if
#[cfg(all(target_arch
=
"x86_64"
,
target_env
=
"sgx"
))]
{
#[path
=
"rdrand.rs"
]
mod
imp
;
}
else
if
#[cfg(all(feature
=
"
cpu
"
,
}
else
if
#[cfg(all(feature
=
"
rdrand
"
,
any(target_arch
=
"x86_64"
,
target_arch
=
"x86"
)))]
{
#[path
=
"rdrand.rs"
]
mod
imp
;
}
else
if
#[cfg(feature
=
"custom"
)]
{
...
...
@@ -219,4 +219,4 @@ pub fn getrandom(dest: &mut [u8]) -> Result<(), Error> {
#[cfg(test)]
mod
test_common
;
#[cfg(test)]
mod
test_
cpu
;
mod
test_
rdrand
;
This diff is collapsed.
Click to expand it.
src/test_
cpu
.rs
→
src/test_
rdrand
.rs
+
1
−
1
View file @
6aba12cc
// We only test the
CPU
-based RNG source on supported architectures.
// We only test the
RDRAND
-based RNG source on supported architectures.
#![cfg(any(target_arch
=
"x86_64"
,
target_arch
=
"x86"
))]
#[path
=
"rdrand.rs"
]
...
...
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