Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Jeff Gough
firmware
Commits
e02671f1
Commit
e02671f1
authored
5 years ago
by
koalo
Committed by
rahix
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(pycardium): Seed urandom with TRNG
parent
7e39537b
No related branches found
Branches containing commit
Tags
v1.1
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pycardium/mpconfigport.h
+4
-0
4 additions, 0 deletions
pycardium/mpconfigport.h
pycardium/mphalport.c
+11
-0
11 additions, 0 deletions
pycardium/mphalport.c
with
15 additions
and
0 deletions
pycardium/mpconfigport.h
+
4
−
0
View file @
e02671f1
...
...
@@ -23,6 +23,9 @@
#define MICROPY_ENABLE_SOURCE_LINE (1)
/* urandom init */
int
mp_hal_trng_read_int
(
void
);
/* Builtin function and modules */
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
#define MICROPY_PY_BUILTINS_HELP (1)
...
...
@@ -32,6 +35,7 @@
#define MICROPY_PY_UJSON (1)
#define MICROPY_PY_URANDOM (1)
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (mp_hal_trng_read_int())
#define MICROPY_PY_URE (1)
#define MICROPY_PY_URE_MATCH_GROUPS (1)
#define MICROPY_PY_URE_MATCH_SPAN_START_END (1)
...
...
This diff is collapsed.
Click to expand it.
pycardium/mphalport.c
+
11
−
0
View file @
e02671f1
...
...
@@ -152,3 +152,14 @@ void NORETURN nlr_jump_fail(void *val)
Reset_Handler
();
}
/******************************************************************************
* TRNG
*/
int
mp_hal_trng_read_int
(
void
)
{
int
result
;
epic_trng_read
((
uint8_t
*
)
&
result
,
sizeof
(
result
));
return
result
;
}
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