/src/openssl35/crypto/ml_dsa/ml_dsa_matrix.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | /* A 'k' by 'l' Matrix object ('k' rows and 'l' columns) containing polynomial scalars */ |
11 | | struct matrix_st { |
12 | | POLY *m_poly; |
13 | | size_t k, l; |
14 | | }; |
15 | | |
16 | | /** |
17 | | * @brief Initialize a Matrix object. |
18 | | * |
19 | | * @param m The matrix object. |
20 | | * @param polys A preallocated array of k * l polynomial blocks. |m| does not |
21 | | * own/free this. |
22 | | * @param k The number of rows |
23 | | * @param l The number of columns |
24 | | */ |
25 | | static ossl_inline ossl_unused void |
26 | | matrix_init(MATRIX *m, POLY *polys, size_t k, size_t l) |
27 | 1.69k | { |
28 | 1.69k | m->k = k; |
29 | 1.69k | m->l = l; |
30 | 1.69k | m->m_poly = polys; |
31 | 1.69k | } Line | Count | Source | 27 | 898 | { | 28 | 898 | m->k = k; | 29 | 898 | m->l = l; | 30 | 898 | m->m_poly = polys; | 31 | 898 | } |
Unexecuted instantiation: ml_dsa_matrix.c:matrix_init Unexecuted instantiation: ml_dsa_sample.c:matrix_init ml_dsa_sign.c:matrix_init Line | Count | Source | 27 | 798 | { | 28 | 798 | m->k = k; | 29 | 798 | m->l = l; | 30 | 798 | m->m_poly = polys; | 31 | 798 | } |
|
32 | | |
33 | | static ossl_inline ossl_unused void |
34 | | matrix_mult_vector(const MATRIX *a, const VECTOR *s, VECTOR *t) |
35 | 3.05k | { |
36 | 3.05k | ossl_ml_dsa_matrix_mult_vector(a, s, t); |
37 | 3.05k | } ml_dsa_key.c:matrix_mult_vector Line | Count | Source | 35 | 898 | { | 36 | 898 | ossl_ml_dsa_matrix_mult_vector(a, s, t); | 37 | 898 | } |
Unexecuted instantiation: ml_dsa_matrix.c:matrix_mult_vector Unexecuted instantiation: ml_dsa_sample.c:matrix_mult_vector ml_dsa_sign.c:matrix_mult_vector Line | Count | Source | 35 | 2.15k | { | 36 | 2.15k | ossl_ml_dsa_matrix_mult_vector(a, s, t); | 37 | 2.15k | } |
|
38 | | |
39 | | static ossl_inline ossl_unused int |
40 | | matrix_expand_A(EVP_MD_CTX *g_ctx, const EVP_MD *md, const uint8_t *rho, |
41 | | MATRIX *out) |
42 | 1.69k | { |
43 | 1.69k | return ossl_ml_dsa_matrix_expand_A(g_ctx, md, rho, out); |
44 | 1.69k | } ml_dsa_key.c:matrix_expand_A Line | Count | Source | 42 | 898 | { | 43 | 898 | return ossl_ml_dsa_matrix_expand_A(g_ctx, md, rho, out); | 44 | 898 | } |
Unexecuted instantiation: ml_dsa_matrix.c:matrix_expand_A Unexecuted instantiation: ml_dsa_sample.c:matrix_expand_A ml_dsa_sign.c:matrix_expand_A Line | Count | Source | 42 | 798 | { | 43 | 798 | return ossl_ml_dsa_matrix_expand_A(g_ctx, md, rho, out); | 44 | 798 | } |
|