diff options
Diffstat (limited to 'src/lib/libc/crypt/blowfish.c')
-rw-r--r-- | src/lib/libc/crypt/blowfish.c | 86 |
1 files changed, 1 insertions, 85 deletions
diff --git a/src/lib/libc/crypt/blowfish.c b/src/lib/libc/crypt/blowfish.c index 695fc00a6a..8be04a6463 100644 --- a/src/lib/libc/crypt/blowfish.c +++ b/src/lib/libc/crypt/blowfish.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: blowfish.c,v 1.15 2001/01/04 21:45:30 todd Exp $ */ | 1 | /* $OpenBSD: blowfish.c,v 1.16 2002/02/19 19:39:36 millert Exp $ */ |
2 | /* | 2 | /* |
3 | * Blowfish block cipher for OpenBSD | 3 | * Blowfish block cipher for OpenBSD |
4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | 4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
@@ -402,16 +402,8 @@ Blowfish_initstate(c) | |||
402 | 402 | ||
403 | } | 403 | } |
404 | 404 | ||
405 | #ifdef __STDC__ | ||
406 | u_int32_t | 405 | u_int32_t |
407 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, u_int16_t *current) | 406 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, u_int16_t *current) |
408 | #else | ||
409 | u_int32_t | ||
410 | Blowfish_stream2word(data, databytes, current) | ||
411 | const u_int8_t *data; | ||
412 | u_int16_t databytes; | ||
413 | u_int16_t *current; | ||
414 | #endif | ||
415 | { | 407 | { |
416 | u_int8_t i; | 408 | u_int8_t i; |
417 | u_int16_t j; | 409 | u_int16_t j; |
@@ -430,16 +422,8 @@ Blowfish_stream2word(data, databytes, current) | |||
430 | return temp; | 422 | return temp; |
431 | } | 423 | } |
432 | 424 | ||
433 | #if __STDC__ | ||
434 | void | 425 | void |
435 | Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) | 426 | Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) |
436 | #else | ||
437 | void | ||
438 | Blowfish_expand0state(c, key, keybytes) | ||
439 | blf_ctx *c; | ||
440 | const u_int8_t *key; | ||
441 | u_int16_t keybytes; | ||
442 | #endif | ||
443 | { | 427 | { |
444 | u_int16_t i; | 428 | u_int16_t i; |
445 | u_int16_t j; | 429 | u_int16_t j; |
@@ -476,19 +460,9 @@ Blowfish_expand0state(c, key, keybytes) | |||
476 | } | 460 | } |
477 | 461 | ||
478 | 462 | ||
479 | #if __STDC__ | ||
480 | void | 463 | void |
481 | Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, | 464 | Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, |
482 | const u_int8_t *key, u_int16_t keybytes) | 465 | const u_int8_t *key, u_int16_t keybytes) |
483 | #else | ||
484 | void | ||
485 | Blowfish_expandstate(c, data, databytes, key, keybytes) | ||
486 | blf_ctx *c; | ||
487 | const u_int8_t *data; | ||
488 | u_int16_t databytes; | ||
489 | const u_int8_t *key; | ||
490 | u_int16_t keybytes; | ||
491 | #endif | ||
492 | { | 466 | { |
493 | u_int16_t i; | 467 | u_int16_t i; |
494 | u_int16_t j; | 468 | u_int16_t j; |
@@ -529,16 +503,8 @@ Blowfish_expandstate(c, data, databytes, key, keybytes) | |||
529 | 503 | ||
530 | } | 504 | } |
531 | 505 | ||
532 | #if __STDC__ | ||
533 | void | 506 | void |
534 | blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) | 507 | blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) |
535 | #else | ||
536 | void | ||
537 | blf_key(c, k, len) | ||
538 | blf_ctx *c; | ||
539 | const u_int8_t *k; | ||
540 | u_int16_t len; | ||
541 | #endif | ||
542 | { | 508 | { |
543 | /* Initialize S-boxes and subkeys with Pi */ | 509 | /* Initialize S-boxes and subkeys with Pi */ |
544 | Blowfish_initstate(c); | 510 | Blowfish_initstate(c); |
@@ -547,16 +513,8 @@ blf_key(c, k, len) | |||
547 | Blowfish_expand0state(c, k, len); | 513 | Blowfish_expand0state(c, k, len); |
548 | } | 514 | } |
549 | 515 | ||
550 | #if __STDC__ | ||
551 | void | 516 | void |
552 | blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | 517 | blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) |
553 | #else | ||
554 | void | ||
555 | blf_enc(c, data, blocks) | ||
556 | blf_ctx *c; | ||
557 | u_int32_t *data; | ||
558 | u_int16_t blocks; | ||
559 | #endif | ||
560 | { | 518 | { |
561 | u_int32_t *d; | 519 | u_int32_t *d; |
562 | u_int16_t i; | 520 | u_int16_t i; |
@@ -568,16 +526,8 @@ blf_enc(c, data, blocks) | |||
568 | } | 526 | } |
569 | } | 527 | } |
570 | 528 | ||
571 | #if __STDC__ | ||
572 | void | 529 | void |
573 | blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | 530 | blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) |
574 | #else | ||
575 | void | ||
576 | blf_dec(c, data, blocks) | ||
577 | blf_ctx *c; | ||
578 | u_int32_t *data; | ||
579 | u_int16_t blocks; | ||
580 | #endif | ||
581 | { | 531 | { |
582 | u_int32_t *d; | 532 | u_int32_t *d; |
583 | u_int16_t i; | 533 | u_int16_t i; |
@@ -589,16 +539,8 @@ blf_dec(c, data, blocks) | |||
589 | } | 539 | } |
590 | } | 540 | } |
591 | 541 | ||
592 | #if __STDC__ | ||
593 | void | 542 | void |
594 | blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) | 543 | blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) |
595 | #else | ||
596 | void | ||
597 | blf_ecb_encrypt(c, data, len) | ||
598 | blf_ctx *c; | ||
599 | u_int8_t *data; | ||
600 | u_int32_t len; | ||
601 | #endif | ||
602 | { | 544 | { |
603 | u_int32_t l, r; | 545 | u_int32_t l, r; |
604 | u_int32_t i; | 546 | u_int32_t i; |
@@ -619,16 +561,8 @@ blf_ecb_encrypt(c, data, len) | |||
619 | } | 561 | } |
620 | } | 562 | } |
621 | 563 | ||
622 | #if __STDC__ | ||
623 | void | 564 | void |
624 | blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) | 565 | blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) |
625 | #else | ||
626 | void | ||
627 | blf_ecb_decrypt(c, data, len) | ||
628 | blf_ctx *c; | ||
629 | u_int8_t *data; | ||
630 | u_int32_t len; | ||
631 | #endif | ||
632 | { | 566 | { |
633 | u_int32_t l, r; | 567 | u_int32_t l, r; |
634 | u_int32_t i; | 568 | u_int32_t i; |
@@ -649,17 +583,8 @@ blf_ecb_decrypt(c, data, len) | |||
649 | } | 583 | } |
650 | } | 584 | } |
651 | 585 | ||
652 | #if __STDC__ | ||
653 | void | 586 | void |
654 | blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) | 587 | blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) |
655 | #else | ||
656 | void | ||
657 | blf_cbc_encrypt(c, iv, data, len) | ||
658 | blf_ctx *c; | ||
659 | u_int8_t *iv; | ||
660 | u_int8_t *data; | ||
661 | u_int32_t len; | ||
662 | #endif | ||
663 | { | 588 | { |
664 | u_int32_t l, r; | 589 | u_int32_t l, r; |
665 | u_int32_t i, j; | 590 | u_int32_t i, j; |
@@ -683,17 +608,8 @@ blf_cbc_encrypt(c, iv, data, len) | |||
683 | } | 608 | } |
684 | } | 609 | } |
685 | 610 | ||
686 | #if __STDC__ | ||
687 | void | 611 | void |
688 | blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) | 612 | blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) |
689 | #else | ||
690 | void | ||
691 | blf_cbc_decrypt(c, iva, data, len) | ||
692 | blf_ctx *c; | ||
693 | u_int8_t *iva; | ||
694 | u_int8_t *data; | ||
695 | u_int32_t len; | ||
696 | #endif | ||
697 | { | 613 | { |
698 | u_int32_t l, r; | 614 | u_int32_t l, r; |
699 | u_int8_t *iv; | 615 | u_int8_t *iv; |