summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_camellia.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_camellia.c')
-rw-r--r--src/lib/libcrypto/evp/e_camellia.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/src/lib/libcrypto/evp/e_camellia.c b/src/lib/libcrypto/evp/e_camellia.c
index 55dcc79922..8da46275a3 100644
--- a/src/lib/libcrypto/evp/e_camellia.c
+++ b/src/lib/libcrypto/evp/e_camellia.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_camellia.c,v 1.20 2024/04/09 13:52:41 beck Exp $ */ 1/* $OpenBSD: e_camellia.c,v 1.22 2025/05/27 03:58:12 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -59,9 +59,9 @@
59 59
60#ifndef OPENSSL_NO_CAMELLIA 60#ifndef OPENSSL_NO_CAMELLIA
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/err.h>
63#include <openssl/camellia.h> 62#include <openssl/camellia.h>
64 63
64#include "err_local.h"
65#include "evp_local.h" 65#include "evp_local.h"
66 66
67/* Camellia subkey Structure */ 67/* Camellia subkey Structure */
@@ -163,13 +163,13 @@ static const EVP_CIPHER camellia_128_cbc = {
163 .block_size = 16, 163 .block_size = 16,
164 .key_len = 16, 164 .key_len = 16,
165 .iv_len = 16, 165 .iv_len = 16,
166 .flags = 0 | EVP_CIPH_CBC_MODE, 166 .flags = EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
167 .init = camellia_init_key, 167 .init = camellia_init_key,
168 .do_cipher = camellia_128_cbc_cipher, 168 .do_cipher = camellia_128_cbc_cipher,
169 .cleanup = NULL, 169 .cleanup = NULL,
170 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 170 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
171 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 171 .set_asn1_parameters = NULL,
172 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 172 .get_asn1_parameters = NULL,
173 .ctrl = NULL, 173 .ctrl = NULL,
174}; 174};
175 175
@@ -185,13 +185,13 @@ static const EVP_CIPHER camellia_128_cfb128 = {
185 .block_size = 1, 185 .block_size = 1,
186 .key_len = 16, 186 .key_len = 16,
187 .iv_len = 16, 187 .iv_len = 16,
188 .flags = 0 | EVP_CIPH_CFB_MODE, 188 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
189 .init = camellia_init_key, 189 .init = camellia_init_key,
190 .do_cipher = camellia_128_cfb128_cipher, 190 .do_cipher = camellia_128_cfb128_cipher,
191 .cleanup = NULL, 191 .cleanup = NULL,
192 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 192 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
193 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 193 .set_asn1_parameters = NULL,
194 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 194 .get_asn1_parameters = NULL,
195 .ctrl = NULL, 195 .ctrl = NULL,
196}; 196};
197 197
@@ -207,13 +207,13 @@ static const EVP_CIPHER camellia_128_ofb = {
207 .block_size = 1, 207 .block_size = 1,
208 .key_len = 16, 208 .key_len = 16,
209 .iv_len = 16, 209 .iv_len = 16,
210 .flags = 0 | EVP_CIPH_OFB_MODE, 210 .flags = EVP_CIPH_OFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
211 .init = camellia_init_key, 211 .init = camellia_init_key,
212 .do_cipher = camellia_128_ofb_cipher, 212 .do_cipher = camellia_128_ofb_cipher,
213 .cleanup = NULL, 213 .cleanup = NULL,
214 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 214 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
215 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 215 .set_asn1_parameters = NULL,
216 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 216 .get_asn1_parameters = NULL,
217 .ctrl = NULL, 217 .ctrl = NULL,
218}; 218};
219 219
@@ -229,13 +229,13 @@ static const EVP_CIPHER camellia_128_ecb = {
229 .block_size = 16, 229 .block_size = 16,
230 .key_len = 16, 230 .key_len = 16,
231 .iv_len = 0, 231 .iv_len = 0,
232 .flags = 0 | EVP_CIPH_ECB_MODE, 232 .flags = EVP_CIPH_ECB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
233 .init = camellia_init_key, 233 .init = camellia_init_key,
234 .do_cipher = camellia_128_ecb_cipher, 234 .do_cipher = camellia_128_ecb_cipher,
235 .cleanup = NULL, 235 .cleanup = NULL,
236 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 236 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
237 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 237 .set_asn1_parameters = NULL,
238 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 238 .get_asn1_parameters = NULL,
239 .ctrl = NULL, 239 .ctrl = NULL,
240}; 240};
241 241
@@ -321,13 +321,13 @@ static const EVP_CIPHER camellia_192_cbc = {
321 .block_size = 16, 321 .block_size = 16,
322 .key_len = 24, 322 .key_len = 24,
323 .iv_len = 16, 323 .iv_len = 16,
324 .flags = 0 | EVP_CIPH_CBC_MODE, 324 .flags = EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
325 .init = camellia_init_key, 325 .init = camellia_init_key,
326 .do_cipher = camellia_192_cbc_cipher, 326 .do_cipher = camellia_192_cbc_cipher,
327 .cleanup = NULL, 327 .cleanup = NULL,
328 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 328 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
329 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 329 .set_asn1_parameters = NULL,
330 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 330 .get_asn1_parameters = NULL,
331 .ctrl = NULL, 331 .ctrl = NULL,
332}; 332};
333 333
@@ -343,13 +343,13 @@ static const EVP_CIPHER camellia_192_cfb128 = {
343 .block_size = 1, 343 .block_size = 1,
344 .key_len = 24, 344 .key_len = 24,
345 .iv_len = 16, 345 .iv_len = 16,
346 .flags = 0 | EVP_CIPH_CFB_MODE, 346 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
347 .init = camellia_init_key, 347 .init = camellia_init_key,
348 .do_cipher = camellia_192_cfb128_cipher, 348 .do_cipher = camellia_192_cfb128_cipher,
349 .cleanup = NULL, 349 .cleanup = NULL,
350 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 350 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
351 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 351 .set_asn1_parameters = NULL,
352 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 352 .get_asn1_parameters = NULL,
353 .ctrl = NULL, 353 .ctrl = NULL,
354}; 354};
355 355
@@ -365,13 +365,13 @@ static const EVP_CIPHER camellia_192_ofb = {
365 .block_size = 1, 365 .block_size = 1,
366 .key_len = 24, 366 .key_len = 24,
367 .iv_len = 16, 367 .iv_len = 16,
368 .flags = 0 | EVP_CIPH_OFB_MODE, 368 .flags = EVP_CIPH_OFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
369 .init = camellia_init_key, 369 .init = camellia_init_key,
370 .do_cipher = camellia_192_ofb_cipher, 370 .do_cipher = camellia_192_ofb_cipher,
371 .cleanup = NULL, 371 .cleanup = NULL,
372 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 372 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
373 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 373 .set_asn1_parameters = NULL,
374 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 374 .get_asn1_parameters = NULL,
375 .ctrl = NULL, 375 .ctrl = NULL,
376}; 376};
377 377
@@ -387,13 +387,13 @@ static const EVP_CIPHER camellia_192_ecb = {
387 .block_size = 16, 387 .block_size = 16,
388 .key_len = 24, 388 .key_len = 24,
389 .iv_len = 0, 389 .iv_len = 0,
390 .flags = 0 | EVP_CIPH_ECB_MODE, 390 .flags = EVP_CIPH_ECB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
391 .init = camellia_init_key, 391 .init = camellia_init_key,
392 .do_cipher = camellia_192_ecb_cipher, 392 .do_cipher = camellia_192_ecb_cipher,
393 .cleanup = NULL, 393 .cleanup = NULL,
394 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 394 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
395 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 395 .set_asn1_parameters = NULL,
396 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 396 .get_asn1_parameters = NULL,
397 .ctrl = NULL, 397 .ctrl = NULL,
398}; 398};
399 399
@@ -479,13 +479,13 @@ static const EVP_CIPHER camellia_256_cbc = {
479 .block_size = 16, 479 .block_size = 16,
480 .key_len = 32, 480 .key_len = 32,
481 .iv_len = 16, 481 .iv_len = 16,
482 .flags = 0 | EVP_CIPH_CBC_MODE, 482 .flags = EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
483 .init = camellia_init_key, 483 .init = camellia_init_key,
484 .do_cipher = camellia_256_cbc_cipher, 484 .do_cipher = camellia_256_cbc_cipher,
485 .cleanup = NULL, 485 .cleanup = NULL,
486 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 486 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
487 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 487 .set_asn1_parameters = NULL,
488 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 488 .get_asn1_parameters = NULL,
489 .ctrl = NULL, 489 .ctrl = NULL,
490}; 490};
491 491
@@ -501,13 +501,13 @@ static const EVP_CIPHER camellia_256_cfb128 = {
501 .block_size = 1, 501 .block_size = 1,
502 .key_len = 32, 502 .key_len = 32,
503 .iv_len = 16, 503 .iv_len = 16,
504 .flags = 0 | EVP_CIPH_CFB_MODE, 504 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
505 .init = camellia_init_key, 505 .init = camellia_init_key,
506 .do_cipher = camellia_256_cfb128_cipher, 506 .do_cipher = camellia_256_cfb128_cipher,
507 .cleanup = NULL, 507 .cleanup = NULL,
508 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 508 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
509 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 509 .set_asn1_parameters = NULL,
510 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 510 .get_asn1_parameters = NULL,
511 .ctrl = NULL, 511 .ctrl = NULL,
512}; 512};
513 513
@@ -523,13 +523,13 @@ static const EVP_CIPHER camellia_256_ofb = {
523 .block_size = 1, 523 .block_size = 1,
524 .key_len = 32, 524 .key_len = 32,
525 .iv_len = 16, 525 .iv_len = 16,
526 .flags = 0 | EVP_CIPH_OFB_MODE, 526 .flags = EVP_CIPH_OFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
527 .init = camellia_init_key, 527 .init = camellia_init_key,
528 .do_cipher = camellia_256_ofb_cipher, 528 .do_cipher = camellia_256_ofb_cipher,
529 .cleanup = NULL, 529 .cleanup = NULL,
530 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 530 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
531 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 531 .set_asn1_parameters = NULL,
532 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 532 .get_asn1_parameters = NULL,
533 .ctrl = NULL, 533 .ctrl = NULL,
534}; 534};
535 535
@@ -545,13 +545,13 @@ static const EVP_CIPHER camellia_256_ecb = {
545 .block_size = 16, 545 .block_size = 16,
546 .key_len = 32, 546 .key_len = 32,
547 .iv_len = 0, 547 .iv_len = 0,
548 .flags = 0 | EVP_CIPH_ECB_MODE, 548 .flags = EVP_CIPH_ECB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
549 .init = camellia_init_key, 549 .init = camellia_init_key,
550 .do_cipher = camellia_256_ecb_cipher, 550 .do_cipher = camellia_256_ecb_cipher,
551 .cleanup = NULL, 551 .cleanup = NULL,
552 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 552 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
553 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 553 .set_asn1_parameters = NULL,
554 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 554 .get_asn1_parameters = NULL,
555 .ctrl = NULL, 555 .ctrl = NULL,
556}; 556};
557 557
@@ -589,13 +589,13 @@ static const EVP_CIPHER camellia_128_cfb1 = {
589 .block_size = 1, 589 .block_size = 1,
590 .key_len = 128/8, 590 .key_len = 128/8,
591 .iv_len = 16, 591 .iv_len = 16,
592 .flags = 0 | EVP_CIPH_CFB_MODE, 592 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
593 .init = camellia_init_key, 593 .init = camellia_init_key,
594 .do_cipher = camellia_128_cfb1_cipher, 594 .do_cipher = camellia_128_cfb1_cipher,
595 .cleanup = NULL, 595 .cleanup = NULL,
596 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 596 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
597 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 597 .set_asn1_parameters = NULL,
598 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 598 .get_asn1_parameters = NULL,
599 .ctrl = NULL, 599 .ctrl = NULL,
600}; 600};
601 601
@@ -633,13 +633,13 @@ static const EVP_CIPHER camellia_192_cfb1 = {
633 .block_size = 1, 633 .block_size = 1,
634 .key_len = 192/8, 634 .key_len = 192/8,
635 .iv_len = 16, 635 .iv_len = 16,
636 .flags = 0 | EVP_CIPH_CFB_MODE, 636 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
637 .init = camellia_init_key, 637 .init = camellia_init_key,
638 .do_cipher = camellia_192_cfb1_cipher, 638 .do_cipher = camellia_192_cfb1_cipher,
639 .cleanup = NULL, 639 .cleanup = NULL,
640 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 640 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
641 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 641 .set_asn1_parameters = NULL,
642 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 642 .get_asn1_parameters = NULL,
643 .ctrl = NULL, 643 .ctrl = NULL,
644}; 644};
645 645
@@ -677,13 +677,13 @@ static const EVP_CIPHER camellia_256_cfb1 = {
677 .block_size = 1, 677 .block_size = 1,
678 .key_len = 256/8, 678 .key_len = 256/8,
679 .iv_len = 16, 679 .iv_len = 16,
680 .flags = 0 | EVP_CIPH_CFB_MODE, 680 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
681 .init = camellia_init_key, 681 .init = camellia_init_key,
682 .do_cipher = camellia_256_cfb1_cipher, 682 .do_cipher = camellia_256_cfb1_cipher,
683 .cleanup = NULL, 683 .cleanup = NULL,
684 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 684 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
685 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 685 .set_asn1_parameters = NULL,
686 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 686 .get_asn1_parameters = NULL,
687 .ctrl = NULL, 687 .ctrl = NULL,
688}; 688};
689 689
@@ -720,13 +720,13 @@ static const EVP_CIPHER camellia_128_cfb8 = {
720 .block_size = 1, 720 .block_size = 1,
721 .key_len = 128/8, 721 .key_len = 128/8,
722 .iv_len = 16, 722 .iv_len = 16,
723 .flags = 0 | EVP_CIPH_CFB_MODE, 723 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
724 .init = camellia_init_key, 724 .init = camellia_init_key,
725 .do_cipher = camellia_128_cfb8_cipher, 725 .do_cipher = camellia_128_cfb8_cipher,
726 .cleanup = NULL, 726 .cleanup = NULL,
727 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 727 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
728 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 728 .set_asn1_parameters = NULL,
729 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 729 .get_asn1_parameters = NULL,
730 .ctrl = NULL, 730 .ctrl = NULL,
731}; 731};
732 732
@@ -762,13 +762,13 @@ static const EVP_CIPHER camellia_192_cfb8 = {
762 .block_size = 1, 762 .block_size = 1,
763 .key_len = 192/8, 763 .key_len = 192/8,
764 .iv_len = 16, 764 .iv_len = 16,
765 .flags = 0 | EVP_CIPH_CFB_MODE, 765 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
766 .init = camellia_init_key, 766 .init = camellia_init_key,
767 .do_cipher = camellia_192_cfb8_cipher, 767 .do_cipher = camellia_192_cfb8_cipher,
768 .cleanup = NULL, 768 .cleanup = NULL,
769 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 769 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
770 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 770 .set_asn1_parameters = NULL,
771 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 771 .get_asn1_parameters = NULL,
772 .ctrl = NULL, 772 .ctrl = NULL,
773}; 773};
774 774
@@ -804,13 +804,13 @@ static const EVP_CIPHER camellia_256_cfb8 = {
804 .block_size = 1, 804 .block_size = 1,
805 .key_len = 256/8, 805 .key_len = 256/8,
806 .iv_len = 16, 806 .iv_len = 16,
807 .flags = 0 | EVP_CIPH_CFB_MODE, 807 .flags = EVP_CIPH_CFB_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1,
808 .init = camellia_init_key, 808 .init = camellia_init_key,
809 .do_cipher = camellia_256_cfb8_cipher, 809 .do_cipher = camellia_256_cfb8_cipher,
810 .cleanup = NULL, 810 .cleanup = NULL,
811 .ctx_size = sizeof(EVP_CAMELLIA_KEY), 811 .ctx_size = sizeof(EVP_CAMELLIA_KEY),
812 .set_asn1_parameters = EVP_CIPHER_set_asn1_iv, 812 .set_asn1_parameters = NULL,
813 .get_asn1_parameters = EVP_CIPHER_get_asn1_iv, 813 .get_asn1_parameters = NULL,
814 .ctrl = NULL, 814 .ctrl = NULL,
815}; 815};
816 816