diff options
author | djm <> | 2010-10-01 22:54:18 +0000 |
---|---|---|
committer | djm <> | 2010-10-01 22:54:18 +0000 |
commit | b204ac0374903f9d6a2fcc50cfd94578e357d00a (patch) | |
tree | 11298f84d1fd40ee808d1e96c219ce8db2ce537e /src/lib/libcrypto/seed/seed_ofb.c | |
parent | 424deb351931af3fd885740bc351436321fad2f9 (diff) | |
parent | f6ca1ae73bb9eabfb510df2cffc2599db98d35a9 (diff) | |
download | openbsd-b204ac0374903f9d6a2fcc50cfd94578e357d00a.tar.gz openbsd-b204ac0374903f9d6a2fcc50cfd94578e357d00a.tar.bz2 openbsd-b204ac0374903f9d6a2fcc50cfd94578e357d00a.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 | } |