CycloneDX/Enum/CryptoPrimitive.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« CycloneDX/Enum/ComponentType.pm ↑ Summary CycloneDX/License/Licensor.pm »
1 package SBOM::CycloneDX::Enum::CryptoPrimitive;
2  
3 16 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 16 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 16 our (@EXPORT_OK, %EXPORT_TAGS, %ENUM);
10  
11 16 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 16 %ENUM = (
14 DRBG => 'drbg',
15 MAC => 'mac',
16 BLOCK_CIPHER => 'block-cipher',
17 STREAM_CIPHER => 'stream-cipher',
18 SIGNATURE => 'signature',
19 HASH => 'hash',
20 PKE => 'pke',
21 XOF => 'xof',
22 KDF => 'kdf',
23 KEY_AGREE => 'key-agree',
24 KEM => 'kem',
25 AE => 'ae',
26 COMBINER => 'combiner',
27 KEY_WRAP => 'key-wrap',
28 OTHER => 'other',
29 UNKNOWN => 'unknown',
30 );
31  
32 16 require constant;
33 16 constant->import(\%ENUM);
34  
35 16 @EXPORT_OK = sort keys %ENUM;
36 16 %EXPORT_TAGS = (all => \@EXPORT_OK);
37  
38 }
39  
40 2 ▶sub values { sort values %ENUM }
Subroutine values: called CC=1 SCAR=0.0
Pod documented
41  
42  
43 16 1;
44  
45 =encoding utf-8
46  
47 =head1 NAME
48  
49 SBOM::CycloneDX::Enum::CryptoPrimitive - primitive
50  
51 =head1 SYNOPSIS
52  
53 use SBOM::CycloneDX::Enum qw(CRYPTO_PRIMITIVE);
54  
55 say CRYPTO_PRIMITIVE->BLOCK_CIPHER;
56  
57  
58 use SBOM::CycloneDX::Enum::CryptoPrimitive;
59  
60 say SBOM::CycloneDX::Enum::CryptoPrimitive->PKE;
61  
62  
63 use SBOM::CycloneDX::Enum::CryptoPrimitive qw(:all);
64  
65 say KDF;
66  
67  
68 =head1 DESCRIPTION
69  
70 L<SBOM::CycloneDX::Enum::CryptoPrimitive> is ENUM package used by L<SBOM::CycloneDX::CryptoProperties::AlgorithmProperties>.
71  
72 Cryptographic building blocks used in higher-level cryptographic systems
73 and protocols. Primitives represent different cryptographic routines:
74 deterministic random bit generators (drbg, e.g. CTR_DRBG from NIST
75 SP800-90A-r1), message authentication codes (mac, e.g. HMAC-SHA-256),
76 blockciphers (e.g. AES), streamciphers (e.g. Salsa20), signatures (e.g.
77 ECDSA), hash functions (e.g. SHA-256), public-key encryption schemes (pke,
78 e.g. RSA), extended output functions (xof, e.g. SHAKE256), key derivation
79 functions (e.g. pbkdf2), key agreement algorithms (e.g. ECDH), key
80 encapsulation mechanisms (e.g. ML-KEM), authenticated encryption (ae, e.g.
81 AES-GCM) and the combination of multiple algorithms (combiner, e.g.
82 SP800-56Cr2).
83  
84  
85 =head1 CONSTANTS
86  
87 =over
88  
89 =item * C<DRBG>, Deterministic Random Bit Generator (DRBG) is a type of
90 pseudorandom number generator designed to produce a sequence of bits from
91 an initial seed value. DRBGs are commonly used in cryptographic
92 applications where reproducibility of random values is important.
93  
94 =item * C<MAC>, In cryptography, a Message Authentication Code (MAC) is
95 information used for authenticating and integrity-checking a message.
96  
97 =item * C<BLOCK_CIPHER>, A block cipher is a symmetric key algorithm that
98 operates on fixed-size blocks of data. It encrypts or decrypts the data in
99 block units, providing confidentiality. Block ciphers are widely used in
100 various cryptographic modes and protocols for secure data transmission.
101  
102 =item * C<STREAM_CIPHER>, A stream cipher is a symmetric key cipher where
103 plaintext digits are combined with a pseudorandom cipher digit stream
104 (keystream).
105  
106 =item * C<SIGNATURE>, In cryptography, a signature is a digital
107 representation of a message or data that proves its origin, identity, and
108 integrity. Digital signatures are generated using cryptographic algorithms
109 and are widely used for authentication and verification in secure
110 communication.
111  
112 =item * C<HASH>, A hash function is a mathematical algorithm that takes an
113 input (or 'message') and produces a fixed-size string of characters, which
114 is typically a hash value. Hash functions are commonly used in various
115 cryptographic applications, including data integrity verification and
116 password hashing.
117  
118 =item * C<PKE>, Public Key Encryption (PKE) is a type of encryption that
119 uses a pair of public and private keys for secure communication. The public
120 key is used for encryption, while the private key is used for decryption.
121 PKE is a fundamental component of public-key cryptography.
122  
123 =item * C<XOF>, An XOF is an extendable output function that can take
124 arbitrary input and creates a stream of output, up to a limit determined by
125 the size of the internal state of the hash function that underlies the XOF.
126  
127 =item * C<KDF>, A Key Derivation Function (KDF) derives key material from
128 another source of entropy while preserving the entropy of the input.
129  
130 =item * C<KEY_AGREE>, In cryptography, a key-agreement is a protocol
131 whereby two or more parties agree on a cryptographic key in such a way that
132 both influence the outcome.
133  
134 =item * C<KEM>, A Key Encapsulation Mechanism (KEM) algorithm is a
135 mechanism for transporting random keying material to a recipient using the
136 recipient's public key.
137  
138 =item * C<AE>, Authenticated Encryption (AE) is a cryptographic process
139 that provides both confidentiality and data integrity. It ensures that the
140 encrypted data has not been tampered with and comes from a legitimate
141 source. AE is commonly used in secure communication protocols.
142  
143 =item * C<COMBINER>, A combiner aggregates many candidates for a
144 cryptographic primitive and generates a new candidate for the same
145 primitive.
146  
147 =item * C<KEY_WRAP>, Key-wrap is a cryptographic technique used to securely
148 encrypt and protect cryptographic keys using algorithms like AES.
149  
150 =item * C<OTHER>, Another primitive type.
151  
152 =item * C<UNKNOWN>, The primitive is not known.
153  
154 =back
155  
156 =head1 SUPPORT
157  
158 =head2 Bugs / Feature Requests
159  
160 Please report any bugs or feature requests through the issue tracker
161 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
162 You will be notified automatically of any progress on your issue.
163  
164 =head2 Source Code
165  
166 This is open source software. The code repository is available for
167 public review and contribution under the terms of the license.
168  
169 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
170  
171 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
172  
173  
174 =head1 AUTHOR
175  
176 =over 4
177  
178 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
179  
180 =back
181  
182  
183 =head1 LICENSE AND COPYRIGHT
184  
185 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
186  
187 This is free software; you can redistribute it and/or modify it under
188 the same terms as the Perl 5 programming language system itself.
189  
190 =cut
« CycloneDX/Enum/ComponentType.pm ↑ Summary CycloneDX/License/Licensor.pm »