Classes | Functions | Variables
spake25519.c File Reference
#include <openssl/curve25519.h>
#include <assert.h>
#include <string.h>
#include <openssl/bytestring.h>
#include <openssl/mem.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include "../internal.h"
#include "./internal.h"
Include dependency graph for spake25519.c:

Go to the source code of this file.

Classes

union  scalar
 

Functions

static void left_shift_3 (uint8_t n[32])
 
static void scalar_add (scalar *dest, const scalar *src)
 
static void scalar_cmov (scalar *dest, const scalar *src, crypto_word_t mask)
 
static void scalar_double (scalar *s)
 
void SPAKE2_CTX_free (SPAKE2_CTX *ctx)
 
SPAKE2_CTXSPAKE2_CTX_new (enum spake2_role_t my_role, const uint8_t *my_name, size_t my_name_len, const uint8_t *their_name, size_t their_name_len)
 
int SPAKE2_generate_msg (SPAKE2_CTX *ctx, uint8_t *out, size_t *out_len, size_t max_out_len, const uint8_t *password, size_t password_len)
 
int SPAKE2_process_msg (SPAKE2_CTX *ctx, uint8_t *out_key, size_t *out_key_len, size_t max_out_key_len, const uint8_t *their_msg, size_t their_msg_len)
 
static void update_with_length_prefix (SHA512_CTX *sha, const uint8_t *data, const size_t len)
 

Variables

static const scalar kOrder
 
static const uint8_t kSpakeMSmallPrecomp [15 *2 *32]
 
static const uint8_t kSpakeNSmallPrecomp [15 *2 *32]
 

Function Documentation

◆ left_shift_3()

static void left_shift_3 ( uint8_t  n[32])
static

Definition at line 306 of file spake25519.c.

◆ scalar_add()

static void scalar_add ( scalar dest,
const scalar src 
)
static

Definition at line 349 of file spake25519.c.

◆ scalar_cmov()

static void scalar_cmov ( scalar dest,
const scalar src,
crypto_word_t  mask 
)
static

Definition at line 330 of file spake25519.c.

◆ scalar_double()

static void scalar_double ( scalar s)
static

Definition at line 338 of file spake25519.c.

◆ SPAKE2_CTX_free()

void SPAKE2_CTX_free ( SPAKE2_CTX ctx)

Definition at line 294 of file spake25519.c.

◆ SPAKE2_CTX_new()

SPAKE2_CTX* SPAKE2_CTX_new ( enum spake2_role_t  my_role,
const uint8_t my_name,
size_t  my_name_len,
const uint8_t their_name,
size_t  their_name_len 
)

Definition at line 271 of file spake25519.c.

◆ SPAKE2_generate_msg()

int SPAKE2_generate_msg ( SPAKE2_CTX ctx,
uint8_t out,
size_t *  out_len,
size_t  max_out_len,
const uint8_t password,
size_t  password_len 
)

Definition at line 359 of file spake25519.c.

◆ SPAKE2_process_msg()

int SPAKE2_process_msg ( SPAKE2_CTX ctx,
uint8_t out_key,
size_t *  out_key_len,
size_t  max_out_key_len,
const uint8_t their_msg,
size_t  their_msg_len 
)

Definition at line 475 of file spake25519.c.

◆ update_with_length_prefix()

static void update_with_length_prefix ( SHA512_CTX sha,
const uint8_t data,
const size_t  len 
)
static

Definition at line 460 of file spake25519.c.

Variable Documentation

◆ kOrder

const scalar kOrder
static
Initial value:
= {{0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,
0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}}

Definition at line 324 of file spake25519.c.

◆ kSpakeMSmallPrecomp

const uint8_t kSpakeMSmallPrecomp[15 *2 *32]
static

Definition at line 188 of file spake25519.c.

◆ kSpakeNSmallPrecomp

const uint8_t kSpakeNSmallPrecomp[15 *2 *32]
static

Definition at line 105 of file spake25519.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:31