Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/crypto/aes.c

    r414 r740  
    113113    }
    114114}
     115
     116void aes_cfb8_encrypt(const uint8_t *in, uint8_t *out,
     117                      size_t length, const AES_KEY *key,
     118                      uint8_t *iv, int forward)
     119{
     120        size_t i;
     121
     122        for (i=0; i < length; i++) {
     123                uint8_t tiv[AES_BLOCK_SIZE*2];
     124
     125                memcpy(tiv, iv, AES_BLOCK_SIZE);
     126                AES_encrypt(iv, iv, key);
     127                if (!forward) {
     128                        tiv[AES_BLOCK_SIZE] = in[i];
     129                }
     130                out[i] = in[i] ^ iv[0];
     131                if (forward) {
     132                        tiv[AES_BLOCK_SIZE] = out[i];
     133                }
     134                memcpy(iv, tiv+1, AES_BLOCK_SIZE);
     135        }
     136}
Note: See TracChangeset for help on using the changeset viewer.