Skip to content

Commit

Permalink
Expose AES_cfb1_encrypt and AES_cfb8_encrypt (#1967)
Browse files Browse the repository at this point in the history
Moved the `AES_cfb1_encrypt` and `AES_cfb8_encrypt` to the
`openssl/aes.h` header to be exposed similarly too `AES_cfb128_encrypt`.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
  • Loading branch information
skmcgrail authored Nov 7, 2024
1 parent 0cfd3ed commit 65d8c94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
9 changes: 0 additions & 9 deletions crypto/fipsmodule/cipher/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,6 @@ ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_KEY *gcm_key,
block128_f *out_block, const uint8_t *key,
size_t key_bytes);

// AES_cfb1_encrypt calls |CRYPTO_cfb128_1_encrypt| using the block
// |AES_encrypt|.
void AES_cfb1_encrypt(const uint8_t *in, uint8_t *out, size_t bits,
const AES_KEY *key, uint8_t *ivec, int *num, int enc);

// AES_cfb8_encrypt calls |CRYPTO_cfb128_8_encrypt| using the block
// |AES_encrypt|.
void AES_cfb8_encrypt(const uint8_t *in, uint8_t *out, size_t len,
const AES_KEY *key, uint8_t *ivec, int *num, int enc);

// EXPERIMENTAL functions for use in the TLS Transfer function. See
// |SSL_to_bytes| for more details.
Expand Down
18 changes: 18 additions & 0 deletions include/openssl/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ OPENSSL_EXPORT void AES_ofb128_encrypt(const uint8_t *in, uint8_t *out,
size_t len, const AES_KEY *key,
uint8_t *ivec, int *num);

// AES_cfb1_encrypt encrypts (or decrypts, if |enc| == |AES_DECRYPT|) |len|
// bytes from |in| to |out|. The |num| parameter must be set to zero on the
// first call. This function may be called in-place with |in| equal to |out|,
// but otherwise the buffers may not partially overlap. A partial overlap may
// overwrite input data before it is read.
OPENSSL_EXPORT void AES_cfb1_encrypt(const uint8_t *in, uint8_t *out,
size_t bits, const AES_KEY *key,
uint8_t *ivec, int *num, int enc);

// AES_cfb8_encrypt encrypts (or decrypts, if |enc| == |AES_DECRYPT|) |len|
// bytes from |in| to |out|. The |num| parameter must be set to zero on the
// first call. This function may be called in-place with |in| equal to |out|,
// but otherwise the buffers may not partially overlap. A partial overlap may
// overwrite input data before it is read.
OPENSSL_EXPORT void AES_cfb8_encrypt(const uint8_t *in, uint8_t *out,
size_t len, const AES_KEY *key,
uint8_t *ivec, int *num, int enc);

// AES_cfb128_encrypt encrypts (or decrypts, if |enc| == |AES_DECRYPT|) |len|
// bytes from |in| to |out|. The |num| parameter must be set to zero on the
// first call. This function may be called in-place with |in| equal to |out|,
Expand Down

0 comments on commit 65d8c94

Please sign in to comment.