Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cbsspeke
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charles Wright
Cbsspeke
Commits
3ae70a0f
Commit
3ae70a0f
authored
1 year ago
by
Charles Wright
Browse files
Options
Downloads
Patches
Plain Diff
Rolling back change to P and V, for compatibility with earlier releases
parent
0592bdfa
Branches
main
Tags
v0.4.2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/Cbsspeke/bsspeke.c
+15
-2
15 additions, 2 deletions
Sources/Cbsspeke/bsspeke.c
with
15 additions
and
2 deletions
Sources/Cbsspeke/bsspeke.c
+
15
−
2
View file @
3ae70a0f
...
...
@@ -421,6 +421,19 @@ void bsspeke_client_generate_hashed_key(
crypto_blake2b_keyed
(
k
,
32
,
client
->
K_password
,
32
,
msg
,
msg_len
);
}
void
bsspeke_client_generate_internal_key
(
uint8_t
k
[
32
],
const
uint8_t
*
msg
,
size_t
msg_len
,
bsspeke_client_ctx
*
client
)
{
crypto_blake2b_ctx
hash_ctx
;
crypto_blake2b_init
(
&
hash_ctx
,
32
);
crypto_blake2b_update
(
&
hash_ctx
,
client
->
K_password
,
32
);
crypto_blake2b_update
(
&
hash_ctx
,
msg
,
msg_len
);
crypto_blake2b_update
(
&
hash_ctx
,
&
null_byte
,
1
);
crypto_blake2b_final
(
&
hash_ctx
,
k
);
}
#ifdef EMSCRIPTEN
EMSCRIPTEN_KEEPALIVE
#endif
...
...
@@ -456,8 +469,8 @@ int bsspeke_client_generate_keys_from_password(
const
char
*
p_modifier
=
"curve_point_p"
;
const
char
*
v_modifier
=
"private_key_v"
;
bsspeke_client_generate_
hashed
_key
(
client
->
p
,
(
const
uint8_t
*
)
p_modifier
,
strlen
(
p_modifier
),
client
);
bsspeke_client_generate_
hashed
_key
(
client
->
v
,
(
const
uint8_t
*
)
v_modifier
,
strlen
(
v_modifier
),
client
);
bsspeke_client_generate_
internal
_key
(
client
->
p
,
(
const
uint8_t
*
)
p_modifier
,
strlen
(
p_modifier
),
client
);
bsspeke_client_generate_
internal
_key
(
client
->
v
,
(
const
uint8_t
*
)
v_modifier
,
strlen
(
v_modifier
),
client
);
clamp
(
client
->
v
);
print_point
(
"p"
,
client
->
p
);
...
...
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