• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pions / srtp / 111
45%
master: 41%

Build:
Build:
LAST BUILD BRANCH: optimize-new-ctr
DEFAULT BRANCH: master
Ran 23 Mar 2019 12:35AM UTC
Jobs 1
Files 13
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
111

Pull #20

travis-ci

web-flow
Optimize AES-CTR encryption/decryption

Much of the time spent is performing `cipher.NewCTR` for each packet.
This function allocates ~600 bytes on the heap each time which is a
little excessive to encrypt 1000 bytes.

I added a `Reset` function that allows cipher reuse. In addition, I sped
up the CTR cipher taking advantage of the fixed aes.BlockSize.

Unfortunately, forking the Go CTR implementation requires `xorBytes`,
which is not exported. There's a Go issue open that will hopefully
export the function because it's pretty useful. Until then, there needs
to be a lot of copy-pasted assembly code related to fast XOR bytes.

https://github.com/golang/go/issues/30553

```
name                 old time/op   new time/op   delta
EncryptRTP-8          3.66µs ± 6%   3.36µs ± 6%   -8.04%  (p=0.001 n=10+10)
EncryptRTPInPlace-8   3.38µs ± 8%   3.13µs ± 5%   -7.33%  (p=0.000 n=10+10)
DecryptRTP-8          3.69µs ± 7%   3.37µs ± 8%   -8.80%  (p=0.000 n=10+10)
Write-8               3.80µs ± 9%   3.45µs ± 5%   -9.33%  (p=0.000 n=10+10)
WriteRTP-8            3.72µs ± 7%   3.46µs ± 8%   -6.96%  (p=0.005 n=10+10)

name                 old speed     new speed     delta
EncryptRTP-8         277MB/s ± 6%  301MB/s ± 6%   +8.76%  (p=0.001 n=10+10)
EncryptRTPInPlace-8  300MB/s ± 7%  323MB/s ± 5%   +7.85%  (p=0.000 n=10+10)
DecryptRTP-8         277MB/s ± 7%  304MB/s ± 7%   +9.68%  (p=0.000 n=10+10)
Write-8              266MB/s ± 8%  294MB/s ± 5%  +10.24%  (p=0.000 n=10+10)
WriteRTP-8           272MB/s ± 7%  293MB/s ± 8%   +7.61%  (p=0.005 n=10+10)
```
Pull Request #20: Optimize AES-CTR encryption/decryption

77 of 77 new or added lines in 6 files covered. (100.0%)

366 of 815 relevant lines covered (44.91%)

107.87 hits per line

Jobs
ID Job ID Ran Files Coverage
1 111.1 (GO111MODULE=on) 23 Mar 2019 12:35AM UTC 0
44.91
Travis Job 111.1
Source Files on build 111
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #111
  • Pull Request #20
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc