summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/seed/seed_ofb.c
diff options
context:
space:
mode:
authordjm <>2010-10-01 22:54:18 +0000
committerdjm <>2010-10-01 22:54:18 +0000
commitf6ca1ae73bb9eabfb510df2cffc2599db98d35a9 (patch)
treedef8296400903465cb96345535c0a56935eb05a4 /src/lib/libcrypto/seed/seed_ofb.c
parent0229f29a33371533962d8b0b8264882afac53d70 (diff)
downloadopenbsd-f6ca1ae73bb9eabfb510df2cffc2599db98d35a9.tar.gz
openbsd-f6ca1ae73bb9eabfb510df2cffc2599db98d35a9.tar.bz2
openbsd-f6ca1ae73bb9eabfb510df2cffc2599db98d35a9.zip
import OpenSSL-1.0.0a
Diffstat (limited to 'src/lib/libcrypto/seed/seed_ofb.c')
-rw-r--r--src/lib/libcrypto/seed/seed_ofb.c18
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
111void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, 111void 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 }