diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-08-14 18:39:29 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-08-14 18:39:29 +0700 |
commit | 56f23bcdee9c54b6fa3222a759d8df3780e8ac68 (patch) | |
tree | e5fca176186ea692606506d78da2d57462abe43c /crypto/src/bcpg/BcpgInputStream.cs | |
parent | Add locking to lazy factory property (diff) | |
parent | Refactor NextPacketTag() (diff) | |
download | BouncyCastle.NET-ed25519-56f23bcdee9c54b6fa3222a759d8df3780e8ac68.tar.xz |
Merge branch 'master' of git.bouncycastle.org:bc-csharp
Conflicts: crypto/src/asn1/x9/X9ECParametersHolder.cs
Diffstat (limited to 'crypto/src/bcpg/BcpgInputStream.cs')
-rw-r--r-- | crypto/src/bcpg/BcpgInputStream.cs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/crypto/src/bcpg/BcpgInputStream.cs b/crypto/src/bcpg/BcpgInputStream.cs index 3c69fbdf5..2e08cd090 100644 --- a/crypto/src/bcpg/BcpgInputStream.cs +++ b/crypto/src/bcpg/BcpgInputStream.cs @@ -105,19 +105,15 @@ namespace Org.BouncyCastle.Bcpg next = true; } - if (nextB >= 0) + if (nextB < 0) + return (PacketTag)nextB; + + int maskB = nextB & 0x3f; + if ((nextB & 0x40) == 0) // old { - if ((nextB & 0x40) != 0) // new - { - return (PacketTag)(nextB & 0x3f); - } - else // old - { - return (PacketTag)((nextB & 0x3f) >> 2); - } + maskB >>= 2; } - - return (PacketTag) nextB; + return (PacketTag)maskB; } public Packet ReadPacket() |