nrfxlib API 0.1.0
Loading...
Searching...
No Matches
ocrypto_sc_p224.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#ifndef OCRYPTO_SC_P224_H
9#define OCRYPTO_SC_P224_H
10
11#include <stddef.h>
12#include <stdint.h>
13
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
21// P-224 scalar modulo group order
22typedef struct {
23 uint32_t w[7]; // little endian
24} ocrypto_sc_p224;
25
26
27// modulo P-224 number
28typedef struct {
29 uint32_t w[7]; // little endian
30} ocrypto_mod_p224;
33// scalar to 28 byte value
34void ocrypto_sc_p224_to28bytes(uint8_t r[28], const ocrypto_sc_p224 *x);
35
36// 28 byte value to scalar
37// return 0 if x < group order
38int ocrypto_sc_p224_from28bytes(ocrypto_sc_p224 *r, const uint8_t x[28]);
39
40// reduce 36 bytes to range 0 < r < group order
41void ocrypto_sc_p224_from36bytes(ocrypto_sc_p224 *r, const uint8_t x[36]);
42
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif /* #ifndef OCRYPTO_SC_P224_H */
void ocrypto_sc_p224_from36bytes(ocrypto_sc_p224 *r, const uint8_t x[36])
int ocrypto_sc_p224_from28bytes(ocrypto_sc_p224 *r, const uint8_t x[28])
void ocrypto_sc_p224_to28bytes(uint8_t r[28], const ocrypto_sc_p224 *x)