diff options
| author | djm <> | 2010-10-01 22:54:19 +0000 |
|---|---|---|
| committer | djm <> | 2010-10-01 22:54:19 +0000 |
| commit | 5bf424abe3e333358a0476841d2085fb5870dde9 (patch) | |
| tree | 03b202b49e2c6367ae5dec12d939ea99c9ca36b3 /src/lib/libcrypto/seed/seed_ofb.c | |
| parent | 31f27c0675424c286ead39df16455abf64c6fb22 (diff) | |
| parent | 2dd8058114e20f1cd7c897166a4ce75ed390ee54 (diff) | |
| download | openbsd-5bf424abe3e333358a0476841d2085fb5870dde9.tar.gz openbsd-5bf424abe3e333358a0476841d2085fb5870dde9.tar.bz2 openbsd-5bf424abe3e333358a0476841d2085fb5870dde9.zip | |
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src/lib/libcrypto/seed/seed_ofb.c')
| -rw-r--r-- | src/lib/libcrypto/seed/seed_ofb.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/lib/libcrypto/seed/seed_ofb.c b/src/lib/libcrypto/seed/seed_ofb.c index e2f3f57a38..3c8ba33bb9 100644 --- a/src/lib/libcrypto/seed/seed_ofb.c +++ b/src/lib/libcrypto/seed/seed_ofb.c | |||
| @@ -105,24 +105,12 @@ | |||
| 105 | * [including the GNU Public Licence.] | 105 | * [including the GNU Public Licence.] |
| 106 | */ | 106 | */ |
| 107 | 107 | ||
| 108 | #include "seed_locl.h" | 108 | #include <openssl/seed.h> |
| 109 | #include <string.h> | 109 | #include <openssl/modes.h> |
| 110 | 110 | ||
| 111 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, | 111 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, |
| 112 | size_t len, const SEED_KEY_SCHEDULE *ks, | 112 | size_t len, const SEED_KEY_SCHEDULE *ks, |
| 113 | unsigned char ivec[SEED_BLOCK_SIZE], int *num) | 113 | unsigned char ivec[SEED_BLOCK_SIZE], int *num) |
| 114 | { | 114 | { |
| 115 | int n; | 115 | CRYPTO_ofb128_encrypt(in,out,len,ks,ivec,num,(block128_f)SEED_encrypt); |
| 116 | |||
| 117 | n = *num; | ||
| 118 | |||
| 119 | while (len--) | ||
| 120 | { | ||
| 121 | if (n == 0) | ||
| 122 | SEED_encrypt(ivec, ivec, ks); | ||
| 123 | *(out++) = *(in++) ^ ivec[n]; | ||
| 124 | n = (n+1) % SEED_BLOCK_SIZE; | ||
| 125 | } | ||
| 126 | |||
| 127 | *num = n; | ||
| 128 | } | 116 | } |
