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
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
card10
firmware
Commits
bb104bd2
Commit
bb104bd2
authored
4 years ago
by
rahix
Browse files
Options
Downloads
Plain Diff
Merge 'Use CSPRNG to seed MP RNG'
Closes
#36
See merge request
!415
parents
81c0b221
73919274
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!415
change(micropython): Use CSPRNG to seed MP RNG
Pipeline
#4768
passed
4 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pycardium/mpconfigport.h
+2
-2
2 additions, 2 deletions
pycardium/mpconfigport.h
pycardium/mphalport.c
+3
-3
3 additions, 3 deletions
pycardium/mphalport.c
with
5 additions
and
5 deletions
pycardium/mpconfigport.h
+
2
−
2
View file @
bb104bd2
...
...
@@ -31,7 +31,7 @@
#define MICROPY_MODULE_WEAK_LINKS (1)
/* urandom init */
int
mp_hal_
t
rng_read_int
(
void
);
int
mp_hal_
csp
rng_read_int
(
void
);
/* Builtin function and modules */
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
...
...
@@ -43,7 +43,7 @@ int mp_hal_trng_read_int(void);
#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_
t
rng_read_int())
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (mp_hal_
csp
rng_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
+
3
−
3
View file @
bb104bd2
...
...
@@ -294,12 +294,12 @@ void NORETURN nlr_jump_fail(void *val)
}
/******************************************************************************
*
T
RNG
*
CSP
RNG
*/
int
mp_hal_
t
rng_read_int
(
void
)
int
mp_hal_
csp
rng_read_int
(
void
)
{
int
result
;
epic_
t
rng_read
((
uint8_t
*
)
&
result
,
sizeof
(
result
));
epic_
csp
rng_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