[webkit-changes] [WebKit/WebKit] 6cd824: [OpenSSL] Use AES_encrypt() directly for AES-CFB8

Yoshiaki JITSUKAWA noreply at github.com
Tue Sep 6 16:53:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6cd824399342726ba98cb1d0bfc223cdb46a02f5
      https://github.com/WebKit/WebKit/commit/6cd824399342726ba98cb1d0bfc223cdb46a02f5
  Author: Yoshiaki Jitsukawa <yoshiaki.jitsukawa at sony.com>
  Date:   2022-09-06 (Tue, 06 Sep 2022)

  Changed paths:
    M Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CFBOpenSSL.cpp

  Log Message:
  -----------
  [OpenSSL] Use AES_encrypt() directly for AES-CFB8
https://bugs.webkit.org/show_bug.cgi?id=244827

Reviewed by Don Olmstead.

EVP_aes_*_cfb8 are not present in boringssl. Implemen CFB8 encryption and
decryption with AES_encrypt().

In CFB8 mode, each byte of plain text is XORed with a stream cipher. This
stream cipher is generated by retrieving the first byte of an encrypted
block for each iteration. The input to the block encryption is initialized
with the initial vector and is updated by shifting the input and feeding back
the output cipher byte (XORed one) of the previous iteration.

This shift could be done by simply memmoving the input buffer every iteration.
However in this implementation we use a blocksize * 2 byte buffer and move
the pointer instead of memmoving every time..

* Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CFBOpenSSL.cpp:
(WebCore::cfb8):
(WebCore::cryptEncrypt):
(WebCore::cryptDecrypt):
(WebCore::aesAlgorithm): Deleted.

Canonical link: https://commits.webkit.org/254206@main




More information about the webkit-changes mailing list