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

pions / srtp
45%
master: 41%

Build:
Build:
LAST BUILD BRANCH: optimize-new-ctr
DEFAULT BRANCH: master
Repo Added 28 Jan 2019 02:51AM UTC
Files 13
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

LAST BUILD ON BRANCH optimize-new-ctr
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 10--fix-out-of-bounds-access
  • constant-time-compare
  • issue-3
  • keying
  • master
  • optimize-generate-counter
  • optimize-new-ctr
  • optimize-session-auth-tag
  • optimize-write-rtp
  • read-buffer
  • session-alloc
  • update-rtcp
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.0.4
  • v1.1.0
  • v1.1.1
  • write-batch

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

Relevant lines Covered
Build:
Build:
815 RELEVANT LINES 366 COVERED LINES
107.87 HITS PER LINE
Source Files on master
Detailed source file information is not available for this build.

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
111 optimize-new-ctr 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 t... Pull #20 23 Mar 2019 12:35AM UTC web-flow travis-ci pending completion  
110 optimize-new-ctr 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 t... push 23 Mar 2019 12:35AM UTC kixelated travis-ci pending completion  
109 noprint-eof Becoming a contributor by changing one line Related to pions/webrtc#361 Pull #19 16 Mar 2019 06:00AM UTC web-flow travis-ci pending completion  
108 noprint-eof Avoid printing EOF Related to pions/webrtc#361 Pull #19 16 Mar 2019 05:41AM UTC web-flow travis-ci pending completion  
107 v1.1.1 Optimize Read with buffering This avoids channel/lock coordination in favor of performing a copy and always adding the packet to a queue. Obviously I hate performing copies, but I think this is the fastest approach with the current API. This fix... push 11 Mar 2019 04:21AM UTC kixelated travis-ci pending completion  
106 master Optimize Read with buffering This avoids channel/lock coordination in favor of performing a copy and always adding the packet to a queue. Obviously I hate performing copies, but I think this is the fastest approach with the current API. This fix... push 11 Mar 2019 04:21AM UTC kixelated travis-ci pending completion  
104 read-buffer Optimize Read with buffering This avoids channel/lock coordination in favor of performing a copy and always adding the packet to a queue. Obviously I hate performing copies, but I think this is the fastest approach with the current API. This fix... push 11 Mar 2019 04:16AM UTC kixelated travis-ci pending completion  
105 read-buffer Optimize Read with buffering This avoids channel/lock coordination in favor of performing a copy and always adding the packet to a queue. Obviously I hate performing copies, but I think this is the fastest approach with the current API. This fix... Pull #15 11 Mar 2019 04:16AM UTC web-flow travis-ci pending completion  
103 master Update information on joining Slack pion.ly provides better instructions on joining push 09 Mar 2019 09:15AM UTC Sean-Der travis-ci pending completion  
102 read-buffer Optimize Read with buffering This avoids channel/lock coordination in favor of performing a copy and always adding the packet to a queue. Obviously I hate performing copies, but I think this is the fastest approach with the current API. This fix... Pull #15 08 Mar 2019 05:06AM UTC web-flow travis-ci pending completion  
See All Builds (96)
  • Repo on GitHub
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