Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
firmware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arist
firmware
Commits
e02671f1
Commit
e02671f1
authored
Aug 21, 2019
by
koalo
Committed by
Rahix
Aug 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(pycardium): Seed urandom with TRNG
parent
7e39537b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
pycardium/mpconfigport.h
pycardium/mpconfigport.h
+4
-0
pycardium/mphalport.c
pycardium/mphalport.c
+11
-0
No files found.
pycardium/mpconfigport.h
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)
...
...
pycardium/mphalport.c
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment