Skip to content

[performance]The buffer parameters in EncryptTls13() cause the AES GCM to run slowly. #10682

@liuhangtao-linkedsemi

Description

@liuhangtao-linkedsemi

Version

decea12 (origin/master, origin/HEAD, master) Merge pull request #9012 from JacobBarthelmeh/release
c34e6ab prepare for release 5.8.2

Description

https://github.com/wolfSSL/wolfssl/blob/master/src/tls13.c

The buffer parameters in EncryptTls13() cause the AES GCM to run slowly.
An independent input buffer is better.

                const byte* aad = output;
                output += args->headerSz;
                ret = EncryptTls13(ssl, output, output, args->size, aad,
                                   (word16)args->headerSz, asyncOkay);
#0  wc_AesEcbEncrypt (aes=aes@entry=0x38522854 <kheap.app_heap+3896932>, out=out@entry=0x38447d24 <kheap.app_heap+3001140> "\v", in=in@entry=0x38542e2c <kheap.app_heap+4029500> "O\344G\036\313FN+b\327\254\032", sz=sz@entry=0x1f0) at /wolfssl/wolfcrypt/src/aes.c:12120
#1  0x08155394 in AES_GCM_encrypt_C (aes=0x38522854 <kheap.app_heap+3896932>, out=0x38447d24 <kheap.app_heap+3001140> "\v", in=0x38447d24 <kheap.app_heap+3001140> "\v", sz=0x1f6, iv=0x1f0 "\360\001", ivSz=0x38522854, authTag=0x38447f1a <kheap.app_heap+3001642> "rol/0FB", authTagSz=0x10, authIn=0x38447d1f <kheap.app_heap+3001135> "\027\003\003\002\006\v", authInSz=0x5) at /wolfssl/wolfcrypt/src/aes.c:8827
#2  wc_AesGcmEncrypt (aes=aes@entry=0x38522854 <kheap.app_heap+3896932>, out=out@entry=0x38447d24 <kheap.app_heap+3001140> "\v", in=in@entry=0x38447d24 <kheap.app_heap+3001140> "\v", sz=sz@entry=0x1f6, iv=iv@entry=0x3852294c <kheap.app_heap+3897180> "O\344G\036\313FN+b\327\254\032", ivSz=ivSz@entry=0xc, authTag=authTag@entry=0x38447f1a <kheap.app_heap+3001642> "rol/0FB", authTagSz=authTagSz@entry=0x10, authIn=authIn@entry=0x38447d1f <kheap.app_heap+3001135> "\027\003\003\002\006\v", authInSz=authInSz@entry=0x5) at /wolfssl/wolfcrypt/src/aes.c:8996
#3  0x08155474 in wc_AesGcmEncrypt_ex (aes=0x38522854 <kheap.app_heap+3896932>, out=out@entry=0x38447d24 <kheap.app_heap+3001140> "\v", in=in@entry=0x38447d24 <kheap.app_heap+3001140> "\v", sz=sz@entry=0x1f6, ivOut=<optimized out>, ivOutSz=ivOutSz@entry=0xc, authTag=authTag@entry=0x38447f1a <kheap.app_heap+3001642> "rol/0FB", authTagSz=authTagSz@entry=0x10, authIn=authIn@entry=0x38447d1f <kheap.app_heap+3001135> "\027\003\003\002\006\v", authInSz=authInSz@entry=0x5) at /wolfssl/wolfcrypt/src/aes.c:10977
#4  0x08148604 in EncryptTls13 (aadSz=0x5, asyncOkay=0x0, ssl=0x38524584 <kheap.app_heap+3904404>, output=0x38447d24 <kheap.app_heap+3001140> "\v", input=0x38447d24 <kheap.app_heap+3001140> "\v", sz=0x206, aad=0x38447d1f <kheap.app_heap+3001135> "\027\003\003\002\006\v") at /wolfssl/src/tls13.c:2668
#5  BuildTls13Message (ssl=ssl@entry=0x38524584 <kheap.app_heap+3904404>, output=0x38447d24 <kheap.app_heap+3001140> "\v", output@entry=0x38447d1f <kheap.app_heap+3001135> "\027\003\003\002\006\v", outSz=outSz@entry=0x260, input=input@entry=0x38447d24 <kheap.app_heap+3001140> "\v", inSz=inSz@entry=0x1f5, type=type@entry=0x16, hashOutput=hashOutput@entry=0x1, sizeOnly=sizeOnly@entry=0x0, asyncOkay=asyncOkay@entry=0x0) at /wolfssl/src/tls13.c:3391
#6  0x08148a8a in SendTls13Certificate (ssl=ssl@entry=0x38524584 <kheap.app_heap+3904404>) at /wolfssl/src/tls13.c:8906
#7  0x0814c56c in wolfSSL_accept_TLSv13 (ssl=0x38524584 <kheap.app_heap+3904404>) at /wolfssl/src/tls13.c:14540

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions