nrfxlib API 2.8.99
Loading...
Searching...
No Matches
ocrypto_srp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
57#ifndef OCRYPTO_SRP_H
58#define OCRYPTO_SRP_H
59
60#include "ocrypto_types.h"
61
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
67
71#define ocrypto_srp_SALT_BYTES (16)
72
76#define ocrypto_srp_VERIFIER_BYTES (384)
77
81#define ocrypto_srp_SECRET_KEY_BYTES (32)
82
86#define ocrypto_srp_PUBLIC_KEY_BYTES (384)
87
91#define ocrypto_srp_SCRAMBLING_PARAMETER_BYTES (64)
92
96#define ocrypto_srp_PREMASTER_SECRET_BYTES (384)
97
101#define ocrypto_srp_SESSION_KEY_BYTES (64)
102
106#define ocrypto_srp_PROOF_BYTES (64)
107
108
131 const uint8_t salt[ocrypto_srp_SALT_BYTES],
132 const uint8_t *user, size_t user_len,
133 const uint8_t *pass, size_t pass_len);
153 uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES],
154 const uint8_t priv_b[ocrypto_srp_SECRET_KEY_BYTES],
155 const uint8_t v[ocrypto_srp_VERIFIER_BYTES]);
167 uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES],
168 const uint8_t priv_b[ocrypto_srp_SECRET_KEY_BYTES],
169 const uint8_t k[ocrypto_srp_PUBLIC_KEY_BYTES],
170 const uint8_t v[ocrypto_srp_VERIFIER_BYTES]);
171
180 unsigned char pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
181 const unsigned char *priv_a, size_t a_len);
182
203 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
204 const uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES]);
205
226 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
227 const uint8_t priv_b[ocrypto_srp_SECRET_KEY_BYTES],
229 const uint8_t v[ocrypto_srp_VERIFIER_BYTES]);
230
252 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
253 const uint8_t priv_b[ocrypto_srp_SECRET_KEY_BYTES],
254 const uint8_t *u, size_t u_len,
255 const uint8_t v[ocrypto_srp_VERIFIER_BYTES]);
256
273 const uint8_t priv_a[ocrypto_srp_SECRET_KEY_BYTES],
274 const uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES],
275 const uint8_t k[ocrypto_srp_PUBLIC_KEY_BYTES],
276 const uint8_t *u,
277 const uint8_t *h, size_t h_len);
278
290 const uint8_t s[ocrypto_srp_PREMASTER_SECRET_BYTES]);
318 uint8_t m1[ocrypto_srp_PROOF_BYTES],
319 const uint8_t *user, size_t user_len,
320 const uint8_t salt[ocrypto_srp_SALT_BYTES],
321 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
322 const uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES],
323 const uint8_t k[ocrypto_srp_SESSION_KEY_BYTES]);
324
340 uint8_t m2[ocrypto_srp_PROOF_BYTES],
341 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
342 const uint8_t m1[ocrypto_srp_PROOF_BYTES],
343 const uint8_t k[ocrypto_srp_SESSION_KEY_BYTES]);
369 ocrypto_srp_ctx *ctx,
371 const uint8_t salt[ocrypto_srp_SALT_BYTES],
372 const uint8_t *user, size_t user_len,
373 const uint8_t *pass, size_t pass_len);
394 ocrypto_srp_ctx *ctx,
395 uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES],
396 const uint8_t priv_b[ocrypto_srp_SECRET_KEY_BYTES],
397 const uint8_t v[ocrypto_srp_VERIFIER_BYTES]);
420 ocrypto_srp_ctx *ctx,
422 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
423 const uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES]);
424
445 ocrypto_srp_ctx *ctx,
447 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
448 const uint8_t priv_b[ocrypto_srp_SECRET_KEY_BYTES],
450 const uint8_t v[ocrypto_srp_VERIFIER_BYTES]);
451
463 ocrypto_srp_ctx *ctx,
465 const uint8_t s[ocrypto_srp_PREMASTER_SECRET_BYTES]);
494 ocrypto_srp_ctx *ctx,
495 uint8_t m1[ocrypto_srp_PROOF_BYTES],
496 const uint8_t *user, size_t user_len,
497 const uint8_t salt[ocrypto_srp_SALT_BYTES],
498 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
499 const uint8_t pub_b[ocrypto_srp_PUBLIC_KEY_BYTES],
500 const uint8_t k[ocrypto_srp_SESSION_KEY_BYTES]);
501
518 ocrypto_srp_ctx *ctx,
519 uint8_t m2[ocrypto_srp_PROOF_BYTES],
520 const uint8_t pub_a[ocrypto_srp_PUBLIC_KEY_BYTES],
521 const uint8_t m1[ocrypto_srp_PROOF_BYTES],
522 const uint8_t k[ocrypto_srp_SESSION_KEY_BYTES]);
525#ifdef __cplusplus
526}
527#endif
528
529#endif
530
void ocrypto_srp_server_public_key(uint8_t pub_b[(384)], const uint8_t priv_b[(32)], const uint8_t k[(384)], const uint8_t v[(384)])
#define ocrypto_srp_SCRAMBLING_PARAMETER_BYTES
Definition ocrypto_srp.h:91
#define ocrypto_srp_SECRET_KEY_BYTES
Definition ocrypto_srp.h:81
void ocrypto_srp_proof_m2(uint8_t m2[(64)], const uint8_t pub_a[(384)], const uint8_t m1[(64)], const uint8_t k[(64)])
#define ocrypto_srp_VERIFIER_BYTES
Definition ocrypto_srp.h:76
int ocrypto_srp_client_premaster_secret(uint8_t s[(384)], const uint8_t priv_a[(32)], const uint8_t pub_b[(384)], const uint8_t k[(384)], const uint8_t *u, const uint8_t *h, size_t h_len)
void ocrypto_srp_public_key_ctx(ocrypto_srp_ctx *ctx, uint8_t pub_b[(384)], const uint8_t priv_b[(32)], const uint8_t v[(384)])
void ocrypto_srp_session_key_ctx(ocrypto_srp_ctx *ctx, uint8_t k[(64)], const uint8_t s[(384)])
void ocrypto_srp_scrambling_parameter_ctx(ocrypto_srp_ctx *ctx, uint8_t u[(64)], const uint8_t pub_a[(384)], const uint8_t pub_b[(384)])
int ocrypto_srp_premaster_secret(uint8_t s[(384)], const uint8_t pub_a[(384)], const uint8_t priv_b[(32)], const uint8_t u[(64)], const uint8_t v[(384)])
int ocrypto_srp_premaster_secret_ctx(ocrypto_srp_ctx *ctx, uint8_t s[(384)], const uint8_t pub_a[(384)], const uint8_t priv_b[(32)], const uint8_t u[(64)], const uint8_t v[(384)])
void ocrypto_srp_proof_m2_ctx(ocrypto_srp_ctx *ctx, uint8_t m2[(64)], const uint8_t pub_a[(384)], const uint8_t m1[(64)], const uint8_t k[(64)])
#define ocrypto_srp_PUBLIC_KEY_BYTES
Definition ocrypto_srp.h:86
void ocrypto_srp_scrambling_parameter(uint8_t u[(64)], const uint8_t pub_a[(384)], const uint8_t pub_b[(384)])
#define ocrypto_srp_SALT_BYTES
Definition ocrypto_srp.h:71
void ocrypto_srp_proof_m1(uint8_t m1[(64)], const uint8_t *user, size_t user_len, const uint8_t salt[(16)], const uint8_t pub_a[(384)], const uint8_t pub_b[(384)], const uint8_t k[(64)])
void ocrypto_srp_verifier_ctx(ocrypto_srp_ctx *ctx, uint8_t v[(384)], const uint8_t salt[(16)], const uint8_t *user, size_t user_len, const uint8_t *pass, size_t pass_len)
#define ocrypto_srp_PROOF_BYTES
Definition ocrypto_srp.h:106
#define ocrypto_srp_PREMASTER_SECRET_BYTES
Definition ocrypto_srp.h:96
void ocrypto_srp_client_public_key(unsigned char pub_a[(384)], const unsigned char *priv_a, size_t a_len)
#define ocrypto_srp_SESSION_KEY_BYTES
Definition ocrypto_srp.h:101
void ocrypto_srp_public_key(uint8_t pub_b[(384)], const uint8_t priv_b[(32)], const uint8_t v[(384)])
int ocrypto_srp_server_premaster_secret(uint8_t s[(384)], const uint8_t pub_a[(384)], const uint8_t priv_b[(32)], const uint8_t *u, size_t u_len, const uint8_t v[(384)])
void ocrypto_srp_session_key(uint8_t k[(64)], const uint8_t s[(384)])
void ocrypto_srp_proof_m1_ctx(ocrypto_srp_ctx *ctx, uint8_t m1[(64)], const uint8_t *user, size_t user_len, const uint8_t salt[(16)], const uint8_t pub_a[(384)], const uint8_t pub_b[(384)], const uint8_t k[(64)])
void ocrypto_srp_verifier(uint8_t v[(384)], const uint8_t salt[(16)], const uint8_t *user, size_t user_len, const uint8_t *pass, size_t pass_len)
Definition ocrypto_types.h:146