Codebase list libcryptx-perl / upstream/0.076
New upstream version 0.076 gregor herrmann 2 years ago
137 changed file(s) with 235 addition(s) and 221 deletion(s). Raw diff Collapse all Expand all
00 Changes for CryptX
1
2 0.076 2022-01-07
3 - fix #80 github actions (mac, windows, cygwin)
4 - fix #79 isolate ltc functions (via -Wl,--exclude-libs,ALL)
5 - fix #68 Segmentation fault on Apache due to symbol clash with libasn1
16
27 0.075 2021-12-25
38 - fix #78 bundled libtomcrypt update branch:develop (commit:673f5ce2 2021-06-04)
161161 int initialized;
162162 } *Crypt__PK__X25519;
163163
164 int mp_tohex_with_leading_zero(mp_int * a, char *str, int maxlen, int minlen) {
164 STATIC int cryptx_internal_mp2hex_with_leading_zero(mp_int * a, char *str, int maxlen, int minlen) {
165165 int len, rv;
166166
167167 if (mp_isneg(a) == MP_YES) {
190190 return MP_OKAY;
191191 }
192192
193 size_t _find_start(const char *name, char *ltcname, size_t ltclen)
193 STATIC size_t cryptx_internal_find_start(const char *name, char *ltcname, size_t ltclen)
194194 {
195195 size_t i, start = 0;
196196 if (name == NULL || strlen(name) + 1 > ltclen) croak("FATAL: invalid name") ;
210210 return start;
211211 }
212212
213 int _find_hash(const char *name)
213 STATIC int cryptx_internal_find_hash(const char *name)
214214 {
215215 char ltcname[100] = { 0 };
216 size_t start = _find_start(name, ltcname, sizeof(ltcname) - 1);
216 size_t start = cryptx_internal_find_start(name, ltcname, sizeof(ltcname) - 1);
217217 /* special cases */
218218 if (strcmp(ltcname + start, "ripemd128") == 0) return find_hash("rmd128");
219219 if (strcmp(ltcname + start, "ripemd160") == 0) return find_hash("rmd160");
225225 return find_hash(ltcname + start);
226226 }
227227
228 int _find_cipher(const char *name)
228 STATIC int cryptx_internal_find_cipher(const char *name)
229229 {
230230 char ltcname[100] = { 0 };
231 size_t start = _find_start(name, ltcname, sizeof(ltcname) - 1);
231 size_t start = cryptx_internal_find_start(name, ltcname, sizeof(ltcname) - 1);
232232 /* special cases */
233233 if (strcmp(ltcname + start, "des-ede") == 0) return find_cipher("3des");
234234 if (strcmp(ltcname + start, "saferp") == 0) return find_cipher("safer+");
235235 return find_cipher(ltcname + start);
236236 }
237237
238 int _find_prng(const char *name)
238 STATIC int cryptx_internal_find_prng(const char *name)
239239 {
240240 char ltcname[100] = { 0 };
241 size_t start = _find_start(name, ltcname, sizeof(ltcname) - 1);
241 size_t start = cryptx_internal_find_start(name, ltcname, sizeof(ltcname) - 1);
242242 return find_prng(ltcname + start);
243243 }
244244
251251 return obj;
252252 }
253253
254 void _ecc_oid_lookup(ecc_key *key)
254 STATIC void cryptx_internal_ecc_oid_lookup(ecc_key *key)
255255 {
256256 int err;
257257 unsigned i, j;
294294 }
295295 }
296296
297 int _ecc_set_curve_from_SV(ecc_key *key, SV *curve)
297 STATIC int cryptx_internal_ecc_set_curve_from_SV(ecc_key *key, SV *curve)
298298 {
299299 dTHX; /* fetch context */
300300 HV *hc, *h;
367367 cu.cofactor = (unsigned long)SvUV(*sv_cofactor);
368368
369369 if ((err = ecc_set_curve(&cu, key)) != CRYPT_OK) return err;
370 if (key->dp.oidlen == 0) _ecc_oid_lookup(key);
370 if (key->dp.oidlen == 0) cryptx_internal_ecc_oid_lookup(key);
371371 return CRYPT_OK;
372372 }
373373 }
5050 "url" : "https://github.com/DCIT/perl-CryptX"
5151 }
5252 },
53 "version" : "0.075",
53 "version" : "0.076",
5454 "x_serialization_backend" : "JSON::PP version 4.07"
5555 }
2323 resources:
2424 bugtracker: https://github.com/DCIT/perl-CryptX/issues
2525 repository: https://github.com/DCIT/perl-CryptX
26 version: '0.075'
26 version: '0.076'
2727 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
6161 MYEXTLIB => "src/liballinone$Config{lib_ext}",
6262 clean => { 'FILES' => join(' ', @myobjs, "src/liballinone$Config{lib_ext}") },
6363 );
64
65 #FIX: https://github.com/DCIT/perl-CryptX/pull/79
66 # not needed on MS Windows
67 # does not work on macos - Apple LLVM 12.0.5 (clang-1205.0.22.9) ld: unknown option: --exclude-libs
68 # does not work on solaris - gcc 9.3.0 - ld: fatal: unrecognized option '--exclude-libs'
69 if ($^O !~ /^(MSWin32|darwin|solaris)$/ && ($Config{ld} =~ /gcc|g\+\+/ || $Config{gccversion})) {
70 push @EUMM_INC_LIB, (LDDLFLAGS => "$Config{lddlflags} -Wl,--exclude-libs,ALL");
71 }
6472 }
6573
6674 my %eumm_args = (
136144
137145 return $extra_targets;
138146 }
147
6767
6868 # COPYRIGHT
6969
70 Copyright (c) 2013-2021 DCIT, a.s. [https://www.dcit.cz](https://www.dcit.cz) / Karel Miko
70 Copyright (c) 2013-2022 DCIT, a.s. [https://www.dcit.cz](https://www.dcit.cz) / Karel Miko
2222 if (!SvPOK(adata)) croak("FATAL: adata must be string/buffer scalar");
2323 h = (unsigned char *) SvPVbyte(adata, h_len);
2424
25 id = _find_cipher(cipher_name);
25 id = cryptx_internal_find_cipher(cipher_name);
2626 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
2727
2828 Newz(0, RETVAL, 1, ccm_state);
173173 if (SvPOK(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
174174 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
175175
176 id = _find_cipher(cipher_name);
176 id = cryptx_internal_find_cipher(cipher_name);
177177 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
178178 output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */
179179 SvPOK_only(output);
208208 if (SvPOK(tagsv)) t = (unsigned char *) SvPVbyte(tagsv, t_len);
209209 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
210210
211 id = _find_cipher(cipher_name);
211 id = cryptx_internal_find_cipher(cipher_name);
212212 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
213213 output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */
214214 SvPOK_only(output);
2222 h = (unsigned char *) SvPVbyte(adata, h_len);
2323 }
2424
25 id = _find_cipher(cipher_name);
25 id = cryptx_internal_find_cipher(cipher_name);
2626 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
2727
2828 Newz(0, RETVAL, 1, eax_state);
177177 if (SvPOK(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
178178 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
179179
180 id = _find_cipher(cipher_name);
180 id = cryptx_internal_find_cipher(cipher_name);
181181 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
182182 output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */
183183 SvPOK_only(output);
212212 if (SvPOK(tagsv)) t = (unsigned char *) SvPVbyte(tagsv, t_len);
213213 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
214214
215 id = _find_cipher(cipher_name);
215 id = cryptx_internal_find_cipher(cipher_name);
216216 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
217217 output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */
218218 SvPOK_only(output);
1616 iv = (unsigned char *)SvPVbyte(nonce, iv_len);
1717 }
1818
19 id = _find_cipher(cipher_name);
19 id = cryptx_internal_find_cipher(cipher_name);
2020 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
2121
2222 Newz(0, RETVAL, 1, gcm_state);
206206 if (SvPOK(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
207207 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
208208
209 id = _find_cipher(cipher_name);
209 id = cryptx_internal_find_cipher(cipher_name);
210210 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
211211 output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */
212212 SvPOK_only(output);
240240 if (SvPOK(tagsv)) t = (unsigned char *) SvPVbyte(tagsv, t_len);
241241 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
242242
243 id = _find_cipher(cipher_name);
243 id = cryptx_internal_find_cipher(cipher_name);
244244 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
245245 output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */
246246 SvPOK_only(output);
1616 if (!SvPOK(nonce)) croak("FATAL: nonce must be string/buffer scalar");
1717 n = (unsigned char *) SvPVbyte(nonce, n_len);
1818
19 id = _find_cipher(cipher_name);
19 id = cryptx_internal_find_cipher(cipher_name);
2020 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
2121
2222 Newz(0, RETVAL, 1, ocb3_state);
243243 if (SvPOK(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
244244 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
245245
246 id = _find_cipher(cipher_name);
246 id = cryptx_internal_find_cipher(cipher_name);
247247 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
248248 output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */
249249 SvPOK_only(output);
277277 if (SvPOK(tagsv)) t = (unsigned char *) SvPVbyte(tagsv, t_len);
278278 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
279279
280 id = _find_cipher(cipher_name);
280 id = cryptx_internal_find_cipher(cipher_name);
281281 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
282282 output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */
283283 SvPOK_only(output);
2424 if (!SvPOK (key)) croak("FATAL: key must be string scalar");
2525 key_data = (unsigned char *)SvPVbyte(key, key_len);
2626
27 id = _find_cipher(cipher_name);
27 id = cryptx_internal_find_cipher(cipher_name);
2828 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
2929
3030 Newz(0, RETVAL, 1, struct cipher_struct);
112112 }
113113 else {
114114 char *name = SvPOK(param) && strcmp(SvPVX(param), "Crypt::Cipher") ? SvPVX(param) : extra;
115 int rv, id = _find_cipher(name);
115 int rv, id = cryptx_internal_find_cipher(name);
116116 if (id == -1) croak("FATAL: find_cipher failed for '%s'", name);
117117 rv = cipher_descriptor[id].block_length;
118118 if (!rv) croak("FATAL: invalid block_length for '%s'", name);
133133 }
134134 else {
135135 char *name = SvPOK(param) && strcmp(SvPVX(param), "Crypt::Cipher") ? SvPVX(param) : extra;
136 int rv, id = _find_cipher(name);
136 int rv, id = cryptx_internal_find_cipher(name);
137137 if (id == -1) croak("FATAL: find_cipher failed for '%s'", name);
138138 rv = cipher_descriptor[id].max_key_length;
139139 if (!rv) croak("FATAL: invalid max_key_length for '%s'", name);
154154 }
155155 else {
156156 char *name = SvPOK(param) && strcmp(SvPVX(param), "Crypt::Cipher") ? SvPVX(param) : extra;
157 int rv, id = _find_cipher(name);
157 int rv, id = cryptx_internal_find_cipher(name);
158158 if (id == -1) croak("FATAL: find_cipher failed for '%s'", name);
159159 rv = cipher_descriptor[id].min_key_length;
160160 if (!rv) croak("FATAL: invalid min_key_length for '%s'", name);
175175 }
176176 else {
177177 char *name = SvPOK(param) && strcmp(SvPVX(param), "Crypt::Cipher") ? SvPVX(param) : extra;
178 int rv, id = _find_cipher(name);
178 int rv, id = cryptx_internal_find_cipher(name);
179179 if (id == -1) croak("FATAL: find_cipher failed for '%s'", name);
180180 rv = cipher_descriptor[id].default_rounds;
181181 if (!rv) XSRETURN_UNDEF;
99 int id;
1010 char *digest_name = strcmp(cname, "Crypt::Digest") == 0 ? pname : cname;
1111
12 id = _find_hash(digest_name);
12 id = cryptx_internal_find_hash(digest_name);
1313 if (id == -1) croak("FATAL: find_hash failed for '%s'", digest_name);
1414
1515 Newz(0, RETVAL, 1, struct digest_struct);
121121 char out[MAXBLOCKSIZE*2+1];
122122 hash_state md;
123123
124 id = _find_hash(digest_name);
124 id = cryptx_internal_find_hash(digest_name);
125125 if (id == -1) croak("FATAL: find_digest failed for '%s'", digest_name);
126126
127127 /* digest_data("SHA1", $data1, $data2, $data3); */
174174 char *digest_name;
175175 int rv, id;
176176 digest_name = SvPOK(param) && strcmp(SvPVX(param), "Crypt::Digest") ? SvPVX(param) : extra;
177 id = _find_hash(digest_name);
177 id = cryptx_internal_find_hash(digest_name);
178178 if (id == -1) croak("FATAL: find_hash failed for '%s'", digest_name);
179179 rv = hash_descriptor[id].hashsize;
180180 if (!rv) croak("FATAL: invalid hashsize for '%s'", digest_name);;
1616 RETVAL = newSVpvn("", 0);
1717 }
1818 else {
19 id = _find_hash(hash_name);
19 id = cryptx_internal_find_hash(hash_name);
2020 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
2121
2222 password_ptr = (unsigned char *)SvPVbyte(password, password_len);
5454 RETVAL = newSVpvn("", 0);
5555 }
5656 else {
57 id = _find_hash(hash_name);
57 id = cryptx_internal_find_hash(hash_name);
5858 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
5959
6060 password_ptr = (unsigned char *)SvPVbyte(password, password_len);
8686 unsigned char *in_ptr = NULL, *salt_ptr = NULL;
8787 STRLEN in_len = 0, salt_len = 0;
8888
89 id = _find_hash(hash_name);
89 id = cryptx_internal_find_hash(hash_name);
9090 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
9191
9292 if (SvPOK(in)) in_ptr = (unsigned char *)SvPVbyte(in, in_len);
114114 RETVAL = newSVpvn("", 0);
115115 }
116116 else {
117 id = _find_hash(hash_name);
117 id = cryptx_internal_find_hash(hash_name);
118118 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
119119
120120 if (SvPOK(in)) in_ptr = (unsigned char *)SvPVbyte(in, in_len);
149149 RETVAL = newSVpvn("", 0);
150150 }
151151 else {
152 id = _find_hash(hash_name);
152 id = cryptx_internal_find_hash(hash_name);
153153 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
154154
155155 if (SvPOK(in)) in_ptr = (unsigned char *)SvPVbyte(in, in_len);
1212 int rv;
1313 int id;
1414
15 id = _find_cipher(cipher_name);
15 id = cryptx_internal_find_cipher(cipher_name);
1616 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1717
1818 if (!SvPOK(key)) croak("FATAL: key must be string/buffer scalar");
118118 char out[MAXBLOCKSIZE*2];
119119 f9_state st;
120120
121 int id = _find_cipher(cipher_name);
121 int id = cryptx_internal_find_cipher(cipher_name);
122122 if (id == -1) croak("FATAL: find_cipher failed for '%s'", cipher_name);
123123 rv = f9_init(&st, id, k, (unsigned long)klen);
124124 if (rv != CRYPT_OK) croak("FATAL: f9_init failed: %s", error_to_string(rv));
1212 int rv;
1313 int id;
1414
15 id = _find_hash(hash_name);
15 id = cryptx_internal_find_hash(hash_name);
1616 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
1717
1818 if (!SvPOK(key)) croak("FATAL: key must be string/buffer scalar");
118118 char out[MAXBLOCKSIZE*2];
119119 hmac_state st;
120120
121 int id = _find_hash(hash_name);
121 int id = cryptx_internal_find_hash(hash_name);
122122 if (id == -1) croak("FATAL: find_digest failed for '%s'", hash_name);
123123 rv = hmac_init(&st, id, k, (unsigned long)klen);
124124 if (rv != CRYPT_OK) croak("FATAL: hmac_init failed: %s", error_to_string(rv));
1212 int rv;
1313 int id;
1414
15 id = _find_cipher(cipher_name);
15 id = cryptx_internal_find_cipher(cipher_name);
1616 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1717
1818 if (!SvPOK(key)) croak("FATAL: key must be string/buffer scalar");
118118 char out[MAXBLOCKSIZE*2];
119119 omac_state st;
120120
121 int id = _find_cipher(cipher_name);
121 int id = cryptx_internal_find_cipher(cipher_name);
122122 if (id == -1) croak("FATAL: find_cipher failed for '%s'", cipher_name);
123123 rv = omac_init(&st, id, k, (unsigned long)klen);
124124 if (rv != CRYPT_OK) croak("FATAL: omac_init failed: %s", error_to_string(rv));
1212 int rv;
1313 int id;
1414
15 id = _find_cipher(cipher_name);
15 id = cryptx_internal_find_cipher(cipher_name);
1616 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1717
1818 if (!SvPOK(key)) croak("FATAL: key must be string/buffer scalar");
118118 char out[MAXBLOCKSIZE*2];
119119 pmac_state st;
120120
121 int id = _find_cipher(cipher_name);
121 int id = cryptx_internal_find_cipher(cipher_name);
122122 if (id == -1) croak("FATAL: find_cipher failed for '%s'", cipher_name);
123123 rv = pmac_init(&st, id, k, (unsigned long)klen);
124124 if (rv != CRYPT_OK) croak("FATAL: pmac_init failed: %s", error_to_string(rv));
1212 int rv;
1313 int id;
1414
15 id = _find_cipher(cipher_name);
15 id = cryptx_internal_find_cipher(cipher_name);
1616 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1717
1818 if (!SvPOK(key)) croak("FATAL: key must be string/buffer scalar");
118118 char out[MAXBLOCKSIZE*2];
119119 xcbc_state st;
120120
121 int id = _find_cipher(cipher_name);
121 int id = cryptx_internal_find_cipher(cipher_name);
122122 if (id == -1) croak("FATAL: find_cipher failed for '%s'", cipher_name);
123123 rv = xcbc_init(&st, id, k, (unsigned long)klen);
124124 if (rv != CRYPT_OK) croak("FATAL: xcbc_init failed: %s", error_to_string(rv));
1313 RETVAL->padlen = 0;
1414 RETVAL->direction = 0;
1515 RETVAL->cipher_rounds = rounds;
16 RETVAL->cipher_id = _find_cipher(cipher_name);
16 RETVAL->cipher_id = cryptx_internal_find_cipher(cipher_name);
1717 if (RETVAL->cipher_id == -1) {
1818 Safefree(RETVAL);
1919 croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1111 if (!RETVAL) croak("FATAL: Newz failed");
1212 RETVAL->direction = 0;
1313 RETVAL->cipher_rounds = rounds;
14 RETVAL->cipher_id = _find_cipher(cipher_name);
14 RETVAL->cipher_id = cryptx_internal_find_cipher(cipher_name);
1515 if (RETVAL->cipher_id == -1) {
1616 Safefree(RETVAL);
1717 croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1111 if (!RETVAL) croak("FATAL: Newz failed");
1212 RETVAL->direction = 0;
1313 RETVAL->cipher_rounds = rounds;
14 RETVAL->cipher_id = _find_cipher(cipher_name);
14 RETVAL->cipher_id = cryptx_internal_find_cipher(cipher_name);
1515 if (RETVAL->cipher_id == -1) {
1616 Safefree(RETVAL);
1717 croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1313 RETVAL->padlen = 0;
1414 RETVAL->direction = 0;
1515 RETVAL->cipher_rounds = rounds;
16 RETVAL->cipher_id = _find_cipher(cipher_name);
16 RETVAL->cipher_id = cryptx_internal_find_cipher(cipher_name);
1717 if (RETVAL->cipher_id == -1) {
1818 Safefree(RETVAL);
1919 croak("FATAL: find_cipfer failed for '%s'", cipher_name);
1111 if (!RETVAL) croak("FATAL: Newz failed");
1212 RETVAL->direction = 0;
1313 RETVAL->cipher_rounds = rounds;
14 RETVAL->cipher_id = _find_cipher(cipher_name);
14 RETVAL->cipher_id = cryptx_internal_find_cipher(cipher_name);
1515 if (RETVAL->cipher_id == -1) {
1616 Safefree(RETVAL);
1717 croak("FATAL: find_cipfer failed for '%s'", cipher_name);
162162 croak("FATAL: key2hash failed - 'x' too big number");
163163 }
164164 if (siz>0) {
165 mp_tohex_with_leading_zero(self->key.x, buf, 20000, 0);
165 cryptx_internal_mp2hex_with_leading_zero(self->key.x, buf, 20000, 0);
166166 not_used = hv_store(rv_hash, "x", 1, newSVpv(buf, strlen(buf)), 0);
167167 }
168168 else{
174174 croak("FATAL: key2hash failed - 'y' too big number");
175175 }
176176 if (siz>0) {
177 mp_tohex_with_leading_zero(self->key.y, buf, 20000, 0);
177 cryptx_internal_mp2hex_with_leading_zero(self->key.y, buf, 20000, 0);
178178 not_used = hv_store(rv_hash, "y", 1, newSVpv(buf, strlen(buf)), 0);
179179 }
180180 else{
186186 croak("FATAL: key2hash failed - 'p' too big number");
187187 }
188188 if (siz>0) {
189 mp_tohex_with_leading_zero(self->key.prime, buf, 20000, 0);
189 cryptx_internal_mp2hex_with_leading_zero(self->key.prime, buf, 20000, 0);
190190 not_used = hv_store(rv_hash, "p", 1, newSVpv(buf, strlen(buf)), 0);
191191 }
192192 else {
199199 croak("FATAL: key2hash failed - 'g' too big number");
200200 }
201201 if (siz>0) {
202 mp_tohex_with_leading_zero(self->key.base, buf, 20000, 0);
202 cryptx_internal_mp2hex_with_leading_zero(self->key.base, buf, 20000, 0);
203203 not_used = hv_store(rv_hash, "g", 1, newSVpv(buf, strlen(buf)), 0);
204204 }
205205 else {
230230 croak("FATAL: key2hash failed - 'p' too big number");
231231 }
232232 if (siz>0) {
233 mp_tohex_with_leading_zero(self->key.prime, buf, 20000, 0);
233 cryptx_internal_mp2hex_with_leading_zero(self->key.prime, buf, 20000, 0);
234234 not_used = hv_store(rv_hash, "p", 1, newSVpv(buf, strlen(buf)), 0);
235235 }
236236 else {
243243 croak("FATAL: key2hash failed - 'g' too big number");
244244 }
245245 if (siz>0) {
246 mp_tohex_with_leading_zero(self->key.base, buf, 20000, 0);
246 cryptx_internal_mp2hex_with_leading_zero(self->key.base, buf, 20000, 0);
247247 not_used = hv_store(rv_hash, "g", 1, newSVpv(buf, strlen(buf)), 0);
248248 }
249249 else {
172172 croak("FATAL: key2hash failed - 'g' too big number");
173173 }
174174 if (siz>0) {
175 mp_tohex_with_leading_zero(self->key.g, buf, 20000, 0);
175 cryptx_internal_mp2hex_with_leading_zero(self->key.g, buf, 20000, 0);
176176 not_used = hv_store(rv_hash, "g", 1, newSVpv(buf, strlen(buf)), 0);
177177 }
178178 else{
184184 croak("FATAL: key2hash failed - 'q' too big number");
185185 }
186186 if (siz>0) {
187 mp_tohex_with_leading_zero(self->key.q, buf, 20000, 0);
187 cryptx_internal_mp2hex_with_leading_zero(self->key.q, buf, 20000, 0);
188188 not_used = hv_store(rv_hash, "q", 1, newSVpv(buf, strlen(buf)), 0);
189189 }
190190 else{
196196 croak("FATAL: key2hash failed - 'p' too big number");
197197 }
198198 if (siz>0) {
199 mp_tohex_with_leading_zero(self->key.p, buf, 20000, 0);
199 cryptx_internal_mp2hex_with_leading_zero(self->key.p, buf, 20000, 0);
200200 not_used = hv_store(rv_hash, "p", 1, newSVpv(buf, strlen(buf)), 0);
201201 }
202202 else{
208208 croak("FATAL: key2hash failed - 'x' too big number");
209209 }
210210 if (siz>0) {
211 mp_tohex_with_leading_zero(self->key.x, buf, 20000, qsize*2);
211 cryptx_internal_mp2hex_with_leading_zero(self->key.x, buf, 20000, qsize*2);
212212 not_used = hv_store(rv_hash, "x", 1, newSVpv(buf, strlen(buf)), 0);
213213 }
214214 else{
220220 croak("FATAL: key2hash failed - 'y' too big number");
221221 }
222222 if (siz>0) {
223 mp_tohex_with_leading_zero(self->key.y, buf, 20000, psize*2);
223 cryptx_internal_mp2hex_with_leading_zero(self->key.y, buf, 20000, psize*2);
224224 not_used = hv_store(rv_hash, "y", 1, newSVpv(buf, strlen(buf)), 0);
225225 }
226226 else{
273273
274274 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
275275
276 hash_id = _find_hash(hash_name);
276 hash_id = cryptx_internal_find_hash(hash_name);
277277 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
278278 rv = dsa_encrypt_key(data_ptr, (unsigned long)data_len, buffer, &buffer_len,
279279 &self->pstate, self->pindex,
316316
317317 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
318318 if (ix == 1) {
319 id = _find_hash(hash_name);
319 id = cryptx_internal_find_hash(hash_name);
320320 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
321321 rv = hash_memory(id, data_ptr, (unsigned long)data_len, tmp, &tmp_len);
322322 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
346346 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
347347 sig_ptr = (unsigned char *)SvPVbyte(sig, sig_len);
348348 if (ix == 1) {
349 id = _find_hash(hash_name);
349 id = cryptx_internal_find_hash(hash_name);
350350 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
351351 rv = hash_memory(id, data_ptr, (unsigned long)data_len, tmp, &tmp_len);
352352 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
2929 {
3030 int rv;
3131 /* setup dp structure */
32 rv = _ecc_set_curve_from_SV(&self->key, curve); /* croaks on error */
32 rv = cryptx_internal_ecc_set_curve_from_SV(&self->key, curve); /* croaks on error */
3333 if (rv != CRYPT_OK) croak("FATAL: ecc_set_curve failed: %s", error_to_string(rv));
3434 /* gen the key */
3535 rv = ecc_generate_key(&self->pstate, self->pindex, &self->key);
111111 data = (unsigned char *)SvPVbyte(key_data, data_len);
112112 if (self->key.type != -1) { ecc_free(&self->key); self->key.type = -1; }
113113 /* setup dp structure */
114 rv = _ecc_set_curve_from_SV(&self->key, curve); /* croaks on error */
114 rv = cryptx_internal_ecc_set_curve_from_SV(&self->key, curve); /* croaks on error */
115115 if (rv != CRYPT_OK) croak("FATAL: ecc_set_curve failed: %s", error_to_string(rv));
116116 /* import key */
117117 type = (data_len == (STRLEN)ecc_get_size(&self->key)) ? PK_PRIVATE : PK_PUBLIC;
153153 croak("FATAL: key2hash failed - 'k' too big number");
154154 }
155155 if (siz>0) {
156 mp_tohex_with_leading_zero(self->key.k, buf, 20000, esize*2);
156 cryptx_internal_mp2hex_with_leading_zero(self->key.k, buf, 20000, esize*2);
157157 not_used = hv_store(rv_hash, "k", 1, newSVpv(buf, strlen(buf)), 0);
158158 }
159159 else{
165165 croak("FATAL: key2hash failed - 'pub_x' too big number");
166166 }
167167 if (siz>0) {
168 mp_tohex_with_leading_zero(self->key.pubkey.x, buf, 20000, esize*2);
168 cryptx_internal_mp2hex_with_leading_zero(self->key.pubkey.x, buf, 20000, esize*2);
169169 not_used = hv_store(rv_hash, "pub_x", 5, newSVpv(buf, strlen(buf)), 0);
170170 }
171171 else{
177177 croak("FATAL: key2hash failed - 'pub_y' too big number");
178178 }
179179 if (siz>0) {
180 mp_tohex_with_leading_zero(self->key.pubkey.y, buf, 20000, esize*2);
180 cryptx_internal_mp2hex_with_leading_zero(self->key.pubkey.y, buf, 20000, esize*2);
181181 not_used = hv_store(rv_hash, "pub_y", 5, newSVpv(buf, strlen(buf)), 0);
182182 }
183183 else{
186186 /* curve_... */
187187 {
188188 not_used = hv_store(rv_hash, "curve_cofactor", 14, newSViv(self->key.dp.cofactor), 0);
189 mp_tohex_with_leading_zero(self->key.dp.prime, buf, 20000, 0);
189 cryptx_internal_mp2hex_with_leading_zero(self->key.dp.prime, buf, 20000, 0);
190190 not_used = hv_store(rv_hash, "curve_prime", 11, newSVpv(buf, strlen(buf)), 0);
191 mp_tohex_with_leading_zero(self->key.dp.A, buf, 20000, 0);
191 cryptx_internal_mp2hex_with_leading_zero(self->key.dp.A, buf, 20000, 0);
192192 not_used = hv_store(rv_hash, "curve_A", 7, newSVpv(buf, strlen(buf)), 0);
193 mp_tohex_with_leading_zero(self->key.dp.B, buf, 20000, 0);
193 cryptx_internal_mp2hex_with_leading_zero(self->key.dp.B, buf, 20000, 0);
194194 not_used = hv_store(rv_hash, "curve_B", 7, newSVpv(buf, strlen(buf)), 0);
195 mp_tohex_with_leading_zero(self->key.dp.order, buf, 20000, 0);
195 cryptx_internal_mp2hex_with_leading_zero(self->key.dp.order, buf, 20000, 0);
196196 not_used = hv_store(rv_hash, "curve_order", 11, newSVpv(buf, strlen(buf)), 0);
197 mp_tohex_with_leading_zero(self->key.dp.base.x, buf, 20000, 0);
197 cryptx_internal_mp2hex_with_leading_zero(self->key.dp.base.x, buf, 20000, 0);
198198 not_used = hv_store(rv_hash, "curve_Gx", 8, newSVpv(buf, strlen(buf)), 0);
199 mp_tohex_with_leading_zero(self->key.dp.base.y, buf, 20000, 0);
199 cryptx_internal_mp2hex_with_leading_zero(self->key.dp.base.y, buf, 20000, 0);
200200 not_used = hv_store(rv_hash, "curve_Gy", 8, newSVpv(buf, strlen(buf)), 0);
201201 not_used = hv_store(rv_hash, "curve_bytes", 11, newSViv(mp_unsigned_bin_size(self->key.dp.prime)), 0);
202202 not_used = hv_store(rv_hash, "curve_bits", 10, newSViv(mp_count_bits(self->key.dp.prime)), 0);
325325
326326 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
327327
328 hash_id = _find_hash(hash_name);
328 hash_id = cryptx_internal_find_hash(hash_name);
329329 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
330330 rv = ecc_encrypt_key(data_ptr, (unsigned long)data_len, buffer, &buffer_len,
331331 &self->pstate, self->pindex,
370370
371371 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
372372 if (ix == 1 || ix == 2) {
373 id = _find_hash(hash_name);
373 id = cryptx_internal_find_hash(hash_name);
374374 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
375375 rv = hash_memory(id, data_ptr, (unsigned long)data_len, tmp, &tmp_len);
376376 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
409409 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
410410 sig_ptr = (unsigned char *)SvPVbyte(sig, sig_len);
411411 if (ix == 1 || ix == 2) {
412 id = _find_hash(hash_name);
412 id = cryptx_internal_find_hash(hash_name);
413413 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
414414 rv = hash_memory(id, data_ptr, (unsigned long)data_len, tmp, &tmp_len);
415415 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
168168 croak("FATAL: key2hash failed - 'e' too big number");
169169 }
170170 if (siz>0) {
171 mp_tohex_with_leading_zero(self->key.e, buf, 20000, 0);
171 cryptx_internal_mp2hex_with_leading_zero(self->key.e, buf, 20000, 0);
172172 not_used = hv_store(rv_hash, "e", 1, newSVpv(buf, strlen(buf)), 0);
173173 }
174174 else{
180180 croak("FATAL: key2hash failed - 'd' too big number");
181181 }
182182 if (siz>0) {
183 mp_tohex_with_leading_zero(self->key.d, buf, 20000, 0);
183 cryptx_internal_mp2hex_with_leading_zero(self->key.d, buf, 20000, 0);
184184 not_used = hv_store(rv_hash, "d", 1, newSVpv(buf, strlen(buf)), 0);
185185 }
186186 else{
192192 croak("FATAL: key2hash failed - 'N' too big number");
193193 }
194194 if (siz>0) {
195 mp_tohex_with_leading_zero(self->key.N, buf, 20000, 0);
195 cryptx_internal_mp2hex_with_leading_zero(self->key.N, buf, 20000, 0);
196196 not_used = hv_store(rv_hash, "N", 1, newSVpv(buf, strlen(buf)), 0);
197197 }
198198 else{
204204 croak("FATAL: key2hash failed - 'q' too big number");
205205 }
206206 if (siz>0) {
207 mp_tohex_with_leading_zero(self->key.q, buf, 20000, 0);
207 cryptx_internal_mp2hex_with_leading_zero(self->key.q, buf, 20000, 0);
208208 not_used = hv_store(rv_hash, "q", 1, newSVpv(buf, strlen(buf)), 0);
209209 }
210210 else{
216216 croak("FATAL: key2hash failed - 'p' too big number");
217217 }
218218 if (siz>0) {
219 mp_tohex_with_leading_zero(self->key.p, buf, 20000, 0);
219 cryptx_internal_mp2hex_with_leading_zero(self->key.p, buf, 20000, 0);
220220 not_used = hv_store(rv_hash, "p", 1, newSVpv(buf, strlen(buf)), 0);
221221 }
222222 else{
228228 croak("FATAL: key2hash failed - 'qP' too big number");
229229 }
230230 if (siz>0) {
231 mp_tohex_with_leading_zero(self->key.qP, buf, 20000, 0);
231 cryptx_internal_mp2hex_with_leading_zero(self->key.qP, buf, 20000, 0);
232232 not_used = hv_store(rv_hash, "qP", 2, newSVpv(buf, strlen(buf)), 0);
233233 }
234234 else{
240240 croak("FATAL: key2hash failed - 'dP' too big number");
241241 }
242242 if (siz>0) {
243 mp_tohex_with_leading_zero(self->key.dP, buf, 20000, 0);
243 cryptx_internal_mp2hex_with_leading_zero(self->key.dP, buf, 20000, 0);
244244 not_used = hv_store(rv_hash, "dP", 2, newSVpv(buf, strlen(buf)), 0);
245245 }
246246 else{
252252 croak("FATAL: key2hash failed - 'dQ' too big number");
253253 }
254254 if (siz>0) {
255 mp_tohex_with_leading_zero(self->key.dQ, buf, 20000, 0);
255 cryptx_internal_mp2hex_with_leading_zero(self->key.dQ, buf, 20000, 0);
256256 not_used = hv_store(rv_hash, "dQ", 2, newSVpv(buf, strlen(buf)), 0);
257257 }
258258 else{
309309
310310 RETVAL = newSVpvn(NULL, 0); /* undef */
311311 if (strnEQ(padding, "oaep", 4)) {
312 hash_id = _find_hash(oaep_hash);
312 hash_id = cryptx_internal_find_hash(oaep_hash);
313313 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", oaep_hash);
314314 if (oaep_lparam) lparam_ptr = (unsigned char *)SvPVbyte(oaep_lparam, lparam_len);
315315 rv = rsa_encrypt_key_ex(data_ptr, (unsigned long)data_len, buffer, &buffer_len, lparam_ptr, (unsigned long)lparam_len,
354354
355355 RETVAL = newSVpvn(NULL, 0); /* undef */
356356 if (strnEQ(padding, "oaep", 4)) {
357 hash_id = _find_hash(oaep_hash);
357 hash_id = cryptx_internal_find_hash(oaep_hash);
358358 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", oaep_hash);
359359 if (oaep_lparam) lparam_ptr = (unsigned char *)SvPVbyte(oaep_lparam, lparam_len);
360360 rv = rsa_decrypt_key_ex(data_ptr, (unsigned long)data_len, buffer, &buffer_len, lparam_ptr, (unsigned long)lparam_len,
396396
397397 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
398398 if (ix == 1) {
399 hash_id = _find_hash(hash_name);
399 hash_id = cryptx_internal_find_hash(hash_name);
400400 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
401401 rv = hash_memory(hash_id, data_ptr, (unsigned long)data_len, tmp, &tmp_len);
402402 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
404404 data_len = tmp_len;
405405 }
406406 if (strnEQ(padding, "pss", 3)) {
407 hash_id = _find_hash(hash_name);
407 hash_id = cryptx_internal_find_hash(hash_name);
408408 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
409409 rv = rsa_sign_hash_ex(data_ptr, (unsigned long)data_len, buffer, &buffer_len, LTC_PKCS_1_PSS,
410410 &self->pstate, self->pindex,
413413 RETVAL = newSVpvn((char*)buffer, buffer_len);
414414 }
415415 else if (strnEQ(padding, "v1.5", 4)) {
416 hash_id = _find_hash(hash_name);
416 hash_id = cryptx_internal_find_hash(hash_name);
417417 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
418418 rv = rsa_sign_hash_ex(data_ptr, (unsigned long)data_len, buffer, &buffer_len, LTC_PKCS_1_V1_5,
419419 &self->pstate, self->pindex,
448448 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
449449 sig_ptr = (unsigned char *)SvPVbyte(sig, sig_len);
450450 if (ix == 1) {
451 hash_id = _find_hash(hash_name);
451 hash_id = cryptx_internal_find_hash(hash_name);
452452 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
453453 rv = hash_memory(hash_id, data_ptr, (unsigned long)data_len, tmp, &tmp_len);
454454 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
458458 RETVAL = 1;
459459 stat = 0;
460460 if (strnEQ(padding, "pss", 3)) {
461 hash_id = _find_hash(hash_name);
461 hash_id = cryptx_internal_find_hash(hash_name);
462462 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
463463 rv = rsa_verify_hash_ex(sig_ptr, (unsigned long)sig_len, data_ptr, (unsigned long)data_len, LTC_PKCS_1_PSS,
464464 hash_id, saltlen, &stat, &self->key);
465465 if (rv != CRYPT_OK || stat != 1) RETVAL = 0;
466466 }
467467 else if (strnEQ(padding, "v1.5", 4)) {
468 hash_id = _find_hash(hash_name);
468 hash_id = cryptx_internal_find_hash(hash_name);
469469 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
470470 rv = rsa_verify_hash_ex(sig_ptr, (unsigned long)sig_len, data_ptr, (unsigned long)data_len, LTC_PKCS_1_V1_5,
471471 hash_id, 0, &stat, &self->key);
2424 Newz(0, RETVAL, 1, struct prng_struct);
2525 if (!RETVAL) croak("FATAL: Newz failed");
2626
27 id = _find_prng(prng_name);
27 id = cryptx_internal_find_prng(prng_name);
2828 if (id == -1) {
2929 Safefree(RETVAL);
3030 croak("FATAL: find_prng failed for '%s'", prng_name);
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( ccm_encrypt_authenticate ccm_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( chacha20poly1305_encrypt_authenticate chacha20poly1305_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( eax_encrypt_authenticate eax_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( gcm_encrypt_authenticate gcm_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( ocb_encrypt_authenticate ocb_decrypt_verify )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 ### not used
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use base qw(Crypt::Checksum Exporter);
77 our %EXPORT_TAGS = ( all => [qw( adler32_data adler32_data_hex adler32_data_int adler32_file adler32_file_hex adler32_file_int )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use base qw(Crypt::Checksum Exporter);
77 our %EXPORT_TAGS = ( all => [qw( crc32_data crc32_data_hex crc32_data_int crc32_file crc32_file_hex crc32_file_int )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw/ adler32_data adler32_data_hex adler32_data_int adler32_file adler32_file_hex adler32_file_int
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Cipher);
99
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_160 blake2b_160_hex blake2b_160_b64 blake2b_160_b64u blake2b_160_file blake2b_160_file_hex blake2b_160_file_b64 blake2b_160_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_256 blake2b_256_hex blake2b_256_b64 blake2b_256_b64u blake2b_256_file blake2b_256_file_hex blake2b_256_file_b64 blake2b_256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_384 blake2b_384_hex blake2b_384_b64 blake2b_384_b64u blake2b_384_file blake2b_384_file_hex blake2b_384_file_b64 blake2b_384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b_512 blake2b_512_hex blake2b_512_b64 blake2b_512_b64u blake2b_512_file blake2b_512_file_hex blake2b_512_file_b64 blake2b_512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_128 blake2s_128_hex blake2s_128_b64 blake2s_128_b64u blake2s_128_file blake2s_128_file_hex blake2s_128_file_b64 blake2s_128_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_160 blake2s_160_hex blake2s_160_b64 blake2s_160_b64u blake2s_160_file blake2s_160_file_hex blake2s_160_file_b64 blake2s_160_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_224 blake2s_224_hex blake2s_224_b64 blake2s_224_b64u blake2s_224_file blake2s_224_file_hex blake2s_224_file_b64 blake2s_224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s_256 blake2s_256_hex blake2s_256_b64 blake2s_256_b64u blake2s_256_file blake2s_256_file_hex blake2s_256_file_b64 blake2s_256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( chaes chaes_hex chaes_b64 chaes_b64u chaes_file chaes_file_hex chaes_file_b64 chaes_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak224 keccak224_hex keccak224_b64 keccak224_b64u keccak224_file keccak224_file_hex keccak224_file_b64 keccak224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak256 keccak256_hex keccak256_b64 keccak256_b64u keccak256_file keccak256_file_hex keccak256_file_b64 keccak256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak384 keccak384_hex keccak384_b64 keccak384_b64u keccak384_file keccak384_file_hex keccak384_file_b64 keccak384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( keccak512 keccak512_hex keccak512_b64 keccak512_b64u keccak512_file keccak512_file_hex keccak512_file_b64 keccak512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md2 md2_hex md2_b64 md2_b64u md2_file md2_file_hex md2_file_b64 md2_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md4 md4_hex md4_b64 md4_b64u md4_file md4_file_hex md4_file_b64 md4_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md5 md5_hex md5_b64 md5_b64u md5_file md5_file_hex md5_file_b64 md5_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd128 ripemd128_hex ripemd128_b64 ripemd128_b64u ripemd128_file ripemd128_file_hex ripemd128_file_b64 ripemd128_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd160 ripemd160_hex ripemd160_b64 ripemd160_b64u ripemd160_file ripemd160_file_hex ripemd160_file_b64 ripemd160_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd320 ripemd320_hex ripemd320_b64 ripemd320_b64u ripemd320_file ripemd320_file_hex ripemd320_file_b64 ripemd320_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha1 sha1_hex sha1_b64 sha1_b64u sha1_file sha1_file_hex sha1_file_b64 sha1_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha224 sha224_hex sha224_b64 sha224_b64u sha224_file sha224_file_hex sha224_file_b64 sha224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha256 sha256_hex sha256_b64 sha256_b64u sha256_file sha256_file_hex sha256_file_b64 sha256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha384 sha384_hex sha384_b64 sha384_b64u sha384_file sha384_file_hex sha384_file_b64 sha384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_224 sha3_224_hex sha3_224_b64 sha3_224_b64u sha3_224_file sha3_224_file_hex sha3_224_file_b64 sha3_224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_256 sha3_256_hex sha3_256_b64 sha3_256_b64u sha3_256_file sha3_256_file_hex sha3_256_file_b64 sha3_256_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_384 sha3_384_hex sha3_384_b64 sha3_384_b64u sha3_384_file sha3_384_file_hex sha3_384_file_b64 sha3_384_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha3_512 sha3_512_hex sha3_512_b64 sha3_512_b64u sha3_512_file sha3_512_file_hex sha3_512_file_b64 sha3_512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha512 sha512_hex sha512_b64 sha512_b64u sha512_file sha512_file_hex sha512_file_b64 sha512_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha512_224 sha512_224_hex sha512_224_b64 sha512_224_b64u sha512_224_file sha512_224_file_hex sha512_224_file_b64 sha512_224_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha512_256 sha512_256_hex sha512_256_b64 sha512_256_b64u sha512_256_file sha512_256_file_hex sha512_256_file_b64 sha512_256_file_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( tiger192 tiger192_hex tiger192_b64 tiger192_b64u tiger192_file tiger192_file_hex tiger192_file_b64 tiger192_file_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( whirlpool whirlpool_hex whirlpool_b64 whirlpool_b64u whirlpool_file whirlpool_file_hex whirlpool_file_b64 whirlpool_file_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( digest_data digest_data_hex digest_data_b64 digest_data_b64u digest_file digest_file_hex digest_file_b64 digest_file_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw(pbkdf1 pbkdf2 hkdf hkdf_expand hkdf_extract)] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b blake2b_hex blake2b_b64 blake2b_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s blake2s_hex blake2s_b64 blake2s_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( f9 f9_hex f9_b64 f9_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( hmac hmac_hex hmac_b64 hmac_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( omac omac_hex omac_b64 omac_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( pmac pmac_hex pmac_b64 pmac_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( pelican pelican_hex pelican_b64 pelican_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( poly1305 poly1305_hex poly1305_b64 poly1305_b64u )] );
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( xcbc xcbc_hex xcbc_b64 xcbc_b64u )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 use Carp 'croak';
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use Crypt::Cipher;
99
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.075';
6 our $VERSION = '0.076';
77
88 use Crypt::Cipher;
99
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 ### not used
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( dh_shared_secret )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( dsa_encrypt dsa_decrypt dsa_sign_message dsa_verify_message dsa_sign_hash dsa_verify_hash )] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( ecc_encrypt ecc_decrypt ecc_sign_message ecc_verify_message ecc_sign_hash ecc_verify_hash ecc_shared_secret )] );
683683 "d":"870MB6gfuTJ4HtUnUvYMyJpr5eUZNP4Bk43bVdj3eAE",
684684 }
685685
686 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
686 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
687687
688688 =item * EC public keys in JSON Web Key (JWK) format
689689
694694 "y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM",
695695 }
696696
697 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
697 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
698698
699699 =back
700700
778778 #or
779779 my $jwk_hash = $pk->export_key_jwk('public', 1);
780780
781 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
781 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
782782
783783 =head2 export_key_jwk_thumbprint
784784
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( )] );
318318 "d":"RcEJum_STotn0j77a5LZnNRX4hNxcsDXSf4rWgwULa0",
319319 }
320320
321 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
321 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
322322
323323 =item * Ed25519 public keys in JSON Web Key (JWK) format
324324
328328 "x":"oF0a6lgwrJplzfs4RmDUl-NpfEa0Gc8s7IXei9JFRZ0",
329329 }
330330
331 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
331 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
332332
333333 =back
334334
381381 #or
382382 my $jwk_hash = $pk->export_key_jwk('public', 1);
383383
384 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
384 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
385385
386386 =head2 export_key_raw
387387
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw(rsa_encrypt rsa_decrypt rsa_sign_message rsa_verify_message rsa_sign_hash rsa_verify_hash)] );
488488 "qi":"GyM_p6JrXySiz1toFgKbWV...4ypu9bMWx3QJBfm0FoYzUIZEVEcOqwmRN81oDAaaBk0KWGDjJHDdDmFW3AN7I-pux_mHZG",
489489 }
490490
491 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
491 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
492492
493493 =item * RSA public keys in JSON Web Key (JWK) format
494494
498498 "e":"AQAB",
499499 }
500500
501 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
501 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
502502
503503 =back
504504
558558 #or
559559 my $jwk_hash = $pk->export_key_jwk('public', 1);
560560
561 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
561 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
562562
563563 =head2 export_key_jwk_thumbprint
564564
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw( )] );
272272 "d":"AC-T0Qulco2N2OlSdyHaujJhwLsb7957S72sYx1FRlE",
273273 }
274274
275 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
275 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
276276
277277 =item * X25519 public keys in JSON Web Key (JWK) format
278278
282282 "x":"6ngG9yGoVwUSyPbvtOjWIMSaUp5N9eqnfexkb7HofkE",
283283 }
284284
285 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
285 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
286286
287287 =back
288288
335335 #or
336336 my $jwk_hash = $pk->export_key_jwk('public', 1);
337337
338 B<BEWARE:> For JWK support you need to have L<JSON::PP>, L<JSON::XS> or L<Cpanel::JSON::XS> module.
338 B<BEWARE:> For JWK support you need to have L<JSON> module installed.
339339
340340 =head2 export_key_raw
341341
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use Carp;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings ;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 require XSLoader;
77 XSLoader::load('CryptX', $VERSION);
110110
111111 =head1 COPYRIGHT
112112
113 Copyright (c) 2013-2021 DCIT, a.s. L<https://www.dcit.cz> / Karel Miko
113 Copyright (c) 2013-2022 DCIT, a.s. L<https://www.dcit.cz> / Karel Miko
114114
115115 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.075';
4 our $VERSION = '0.076';
55
66 use CryptX;
77 use Carp;