]>
git.ipfire.org Git - thirdparty/openssl.git/blob - providers/implementations/encode_decode/encoder_ffc_params.c
2 * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
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
10 /* Utility function for printing DSA/DH params. */
13 #include "encoder_local.h"
15 int ffc_params_prov_print(BIO
*out
, const FFC_PARAMS
*ffc
)
17 if (ffc
->nid
!= NID_undef
) {
19 const char *name
= ffc_named_group_from_uid(ffc
->nid
);
23 if (BIO_printf(out
, "GROUP: %s\n", name
) <= 0)
27 /* How could this be? We should not have a nid in a no-dh build. */
32 if (!ossl_prov_print_labeled_bignum(out
, "P: ", ffc
->p
))
35 if (!ossl_prov_print_labeled_bignum(out
, "Q: ", ffc
->q
))
38 if (!ossl_prov_print_labeled_bignum(out
, "G: ", ffc
->g
))
41 if (!ossl_prov_print_labeled_bignum(out
, "J: ", ffc
->j
))
44 if (ffc
->seed
!= NULL
) {
45 if (!ossl_prov_print_labeled_buf(out
, "SEED:", ffc
->seed
, ffc
->seedlen
))
48 if (ffc
->gindex
!= -1) {
49 if (BIO_printf(out
, "gindex: %d\n", ffc
->gindex
) <= 0)
52 if (ffc
->pcounter
!= -1) {
53 if (BIO_printf(out
, "pcounter: %d\n", ffc
->pcounter
) <= 0)
57 if (BIO_printf(out
, "h: %d\n", ffc
->h
) <= 0)