diff options
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 | } |
