Skip to content

Commit a806f5f

Browse files
committed
crypto: Updated nrf_oberon to version 3.0.2
Adding nrf_oberon v3.0.2 Removing nrf_oberon v3.0.0 Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 0c4b1e2 commit a806f5f

File tree

18 files changed

+188
-1
lines changed

18 files changed

+188
-1
lines changed

crypto/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ zephyr_interface_library_named(nrfxlib_crypto)
1212

1313
if (CONFIG_NRF_OBERON)
1414
set(OBERON_BASE ${CMAKE_CURRENT_SOURCE_DIR}/nrf_oberon)
15-
set(OBERON_VER 3.0.0)
15+
set(OBERON_VER 3.0.2)
1616
set(OBERON_LIB ${OBERON_BASE}/${lib_path}/liboberon_${OBERON_VER}.a)
1717
if(NOT EXISTS ${OBERON_LIB})
1818
message(WARNING "This combination of SoC and floating point ABI is not supported by the nrf_oberon lib."

crypto/nrf_oberon/CHANGELOG.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,68 @@ Changelog - nRF Oberon
55

66
All notable changes to this project are documented in this file.
77

8+
nrf_oberon - 3.0.2
9+
10+
Added
11+
=====
12+
13+
Added the following Oberon crypto libraries for nRF9160, nRF52, and nRF51 architectures.
14+
15+
Added Oberon SRP, Secure Remote Password, ocrypto_srp functions.
16+
17+
.. note::
18+
short-wchar: Those libraries are compiled with a wchar_t size of 16 bits.
19+
20+
21+
* nrf_oberon, nRF9160 variants
22+
23+
* ``cortex-m33/hard-float/liboberon_3.0.2.a``
24+
* ``cortex-m33/soft-float/liboberon_3.0.2.a``
25+
26+
* short-wchar
27+
28+
* ``cortex-m33/hard-float/short-wchar/liboberon_3.0.2.a``
29+
* ``cortex-m33/soft-float/short-wchar/liboberon_3.0.2.a``
30+
31+
* Keil
32+
33+
* ``cortex-m33/hard-float/short-wchar/oberon_3.0.2.lib``
34+
* ``cortex-m33/soft-float/short-wchar/oberon_3.0.2.lib``
35+
36+
* nrf_oberon, nRF52 variants
37+
38+
* ``cortex-m4/hard-float/liboberon_3.0.2.a``
39+
* ``cortex-m4/soft-float/liboberon_3.0.2.a``
40+
41+
* short-wchar
42+
43+
* ``cortex-m4/hard-float/short-wchar/liboberon_3.0.2.a``
44+
* ``cortex-m4/soft-float/short-wchar/liboberon_3.0.2.a``
45+
46+
* Keil
47+
48+
* ``cortex-m4/soft-float/short-wchar/oberon_3.0.2.lib``
49+
* ``cortex-m4/hard-float/short-wchar/oberon_3.0.2.lib``
50+
51+
* nrf_oberon, nRF51 variants
52+
53+
* ``cortex-m0/soft-float/liboberon_3.0.2.a``
54+
55+
* short-wchar
56+
57+
* ``cortex-m0/soft-float/short-wchar/liboberon_3.0.2.a``
58+
59+
* Keil
60+
61+
* ``cortex-m0/soft-float/short-wchar/oberon_3.0.2.lib``
62+
63+
64+
Removed
65+
=======
66+
67+
* All 3.0.0 versions of the library and old include files
68+
69+
870
nrf_oberon - 3.0.0
971

1072
Added
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/*
2+
* Copyright (c) 2019 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
5+
*/
6+
7+
/**@file
8+
* @defgroup nrf_oberon_sha_1 SHA-1 APIs
9+
* @ingroup nrf_oberon
10+
* @{
11+
* @brief Type declarations and APIs for the SHA-1 algorithm.
12+
*
13+
* A fixed-sized message digest is computed from variable length input data.
14+
* The function is practically impossible to revert, and small changes in the
15+
* input message lead to major changes in the message digest.
16+
*
17+
* SHA-1 is no longer considered secure against well-funded opponents;
18+
* replacement by SHA-2 or SHA-3 is recommended.
19+
*/
20+
21+
#ifndef OCRYPTO_SHA1_H
22+
#define OCRYPTO_SHA1_H
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
28+
#include <stddef.h>
29+
#include <stdint.h>
30+
31+
32+
/**
33+
* Length of SHA-1 hash.
34+
*/
35+
#define ocrypto_sha1_BYTES (20)
36+
37+
38+
/**@cond */
39+
typedef struct {
40+
uint32_t h[5];
41+
uint8_t padded[64];
42+
uint32_t length;
43+
size_t bytes;
44+
} ocrypto_sha1_ctx;
45+
/**@endcond */
46+
47+
48+
/**@name Incremental SHA-1 generator.
49+
*
50+
* This group of functions can be used to incrementally compute the SHA-1
51+
* hash for a given message.
52+
*/
53+
/**@{*/
54+
/**
55+
* SHA-1 initialization.
56+
*
57+
* The generator state @p ctx is initialized by this function.
58+
*
59+
* @param[out] ctx Generator state.
60+
*/
61+
void ocrypto_sha1_init(
62+
ocrypto_sha1_ctx *ctx);
63+
64+
/**
65+
* SHA-1 incremental data input.
66+
*
67+
* The generator state @p ctx is updated to hash a message chunk @p in.
68+
*
69+
* This function can be called repeatedly until the whole message is processed.
70+
*
71+
* @param ctx Generator state.
72+
* @param in Input data.
73+
* @param in_len Length of @p in.
74+
*
75+
* @remark Initialization of the generator state @p ctx through
76+
* @c ocrypto_sha1_init is required before this function can be called.
77+
*/
78+
void ocrypto_sha1_update(
79+
ocrypto_sha1_ctx *ctx,
80+
const uint8_t *in, size_t in_len);
81+
82+
/**
83+
* SHA-1 output.
84+
*
85+
* The generator state @p ctx is updated to finalize the hash for the previously
86+
* processed message chunks. The hash is put into @p r.
87+
*
88+
* @param ctx Generator state.
89+
* @param[out] r Generated hash value.
90+
*
91+
* @remark Initialization of the generator state @p ctx through
92+
* @c ocrypto_sha1_init is required before this function can be called.
93+
*
94+
* @remark After return, the generator state @p ctx must no longer be used with
95+
* @c ocrypto_sha1_update and @c ocrypto_sha1_final unless it is
96+
* reinitialized using @c ocrypto_sha1_init.
97+
*/
98+
void ocrypto_sha1_final(
99+
ocrypto_sha1_ctx *ctx,
100+
uint8_t r[ocrypto_sha1_BYTES]);
101+
/**@}*/
102+
103+
/**
104+
* SHA-1 hash.
105+
*
106+
* The SHA-1 hash of a given input message @p in is computed and put into @p r.
107+
*
108+
* **Example**
109+
* @include ocrypto_sha1.c
110+
*
111+
* @param[out] r Generated hash.
112+
* @param in Input data.
113+
* @param in_len Length of @p in.
114+
*/
115+
void ocrypto_sha1(
116+
uint8_t r[ocrypto_sha1_BYTES],
117+
const uint8_t *in, size_t in_len);
118+
119+
#ifdef __cplusplus
120+
}
121+
#endif
122+
123+
#endif
124+
125+
/** @} */

0 commit comments

Comments
 (0)