Skip to content

Commit

Permalink
Separate out parts of processGeneralAuth
Browse files Browse the repository at this point in the history
This should allow us to specialise the code a bit for e.g.
EC prehash signs to make them faster.
  • Loading branch information
arekinath committed May 13, 2020
1 parent e12e0c6 commit 33819af
Show file tree
Hide file tree
Showing 4 changed files with 475 additions and 377 deletions.
8 changes: 4 additions & 4 deletions src/net/cooperi/pivapplet/BufferManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class BufferManager {
* If we already allocated this buffer and can re-use it, just
* do that.
*/
if (buf.data() != null) {
if (buf.isAllocated()) {
final short curLen = buf.len();
if (curLen < size)
buf.expand((short)(size - curLen));
Expand All @@ -104,6 +104,9 @@ public class BufferManager {
for (short idx = 0; idx < MAX_BUFS; ++idx) {
final BaseBuffer buffer = buffers[idx];

if (buffer.maskFull())
continue;

/*
* We've never used this buffer before? Try to allocate
* some space to it.
Expand All @@ -115,9 +118,6 @@ public class BufferManager {
if (data == null)
continue;

if (buffer.maskFull())
continue;

final short bufSize = (short)data.length;

/*
Expand Down
Loading

0 comments on commit 33819af

Please sign in to comment.