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
fa4a9c90
Commit
fa4a9c90
authored
2 years ago
by
Charles Wright
Browse files
Options
Downloads
Patches
Plain Diff
Got this working with the higher-level Swift interface in the BlindSaltSpeke package
parent
64d4f3d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Sources/Cbsspeke/bsspeke.c
+15
-1
15 additions, 1 deletion
Sources/Cbsspeke/bsspeke.c
Sources/Cbsspeke/include/bsspeke.h
+14
-1
14 additions, 1 deletion
Sources/Cbsspeke/include/bsspeke.h
Tests/CbsspekeTests/CbsspekeTests.swift
+1
-1
1 addition, 1 deletion
Tests/CbsspekeTests/CbsspekeTests.swift
with
30 additions
and
3 deletions
Sources/Cbsspeke/bsspeke.c
+
15
−
1
View file @
fa4a9c90
...
...
@@ -232,6 +232,13 @@ bsspeke_server_generate_B(const uint8_t P[32],
}
void
bsspeke_server_get_B
(
uint8_t
B
[
32
],
bsspeke_server_ctx
*
server
)
{
memcpy
(
B
,
server
->
B
,
32
);
}
int
bsspeke_client_generate_keys_from_password
(
const
uint8_t
blind_salt
[
32
],
uint32_t
phf_blocks
,
uint32_t
phf_iterations
,
...
...
@@ -365,6 +372,13 @@ bsspeke_client_generate_A(const uint8_t blind_salt[32],
return
0
;
}
void
bsspeke_client_get_A
(
uint8_t
A
[
32
],
bsspeke_client_ctx
*
client
)
{
memcpy
(
A
,
client
->
A
,
32
);
}
void
bsspeke_client_derive_shared_key
(
const
uint8_t
B
[
32
],
bsspeke_client_ctx
*
client
)
...
...
@@ -455,7 +469,7 @@ bsspeke_server_derive_shared_key(const uint8_t A[32],
}
int
bsspeke_server_verify_client
(
uint8_t
client_verifier
[
32
],
bsspeke_server_verify_client
(
const
uint8_t
client_verifier
[
32
],
bsspeke_server_ctx
*
server
)
{
...
...
This diff is collapsed.
Click to expand it.
Sources/Cbsspeke/include/bsspeke.h
+
14
−
1
View file @
fa4a9c90
...
...
@@ -21,6 +21,9 @@
#ifndef BSSPEKE_H
#define BSSPEKE_H
#include
<stddef.h>
#include
<sys/types.h>
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -34,6 +37,8 @@ extern "C" {
#define BSSPEKE_ARGON2_MIN_PHF_BLOCKS 100000
#define BSSPEKE_ARGON2_MIN_PHF_ITERATIONS 3
//typedef unsigned char uint8_t;
typedef
struct
{
// Login credentials
uint8_t
client_id
[
256
];
...
...
@@ -101,6 +106,10 @@ void
bsspeke_server_generate_B
(
const
uint8_t
P
[
32
],
bsspeke_server_ctx
*
server
);
void
bsspeke_server_get_B
(
uint8_t
B
[
32
],
bsspeke_server_ctx
*
server
);
int
bsspeke_client_generate_P_and_V
(
uint8_t
P
[
32
],
uint8_t
V
[
32
],
const
uint8_t
blind_salt
[
32
],
...
...
@@ -112,6 +121,10 @@ bsspeke_client_generate_A(const uint8_t blind_salt[32],
uint32_t
phf_blocks
,
uint32_t
phf_iterations
,
bsspeke_client_ctx
*
client
);
void
bsspeke_client_get_A
(
uint8_t
A
[
32
],
bsspeke_client_ctx
*
client
);
void
bsspeke_client_derive_shared_key
(
const
uint8_t
B
[
32
],
bsspeke_client_ctx
*
client
);
...
...
@@ -127,7 +140,7 @@ bsspeke_server_derive_shared_key(const uint8_t A[32],
bsspeke_server_ctx
*
server
);
int
bsspeke_server_verify_client
(
uint8_t
client_verifier
[
32
],
bsspeke_server_verify_client
(
const
uint8_t
client_verifier
[
32
],
bsspeke_server_ctx
*
server
);
void
...
...
This diff is collapsed.
Click to expand it.
Tests/CbsspekeTests/CbsspekeTests.swift
+
1
−
1
View file @
fa4a9c90
import
XCTest
@testable
import
BSS
peke
@testable
import
Cbss
peke
final
class
CbsspekeTests
:
XCTestCase
{
func
testExample
()
throws
{
...
...
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