Comments (3)
This is a bug, the code shouldn't panic, but instead it should return an error.
in #489 , code enforces to pass slices of the exact size for unmarshaling keys.
from circl.
Not sure whether it's a bug to panic when the caller breaks the function contract. Not opposed to returning an error instead though.
from circl.
I don't see where this function contract is defined? Nothing in https://pkg.go.dev/github.com/cloudflare/[email protected]/kem#Scheme
IMHO, panic'ing would be OK if it was documented and if it used an explicit check with a proper error message (instead of an out of bounds error).
However, please note that other functions with documented panics don't return an error
(so don't really have a choice). UnmarshalBinaryPrivateKey
does return an error. Moreover, "Unmarshal" is a kind of parsing step, and parsing deals with user-provided input. Panic'ing on bad user-provided input (such as fed from a network protocol) isn't super nice.
from circl.
Related Issues (20)
- [QUESTION]: is blindsign package post-quantum secure ? HOT 4
- Bytes() and SetBytes() are not match in BLS12381 G1 and G2 HOT 3
- repo: consider add govulncheck to CI job
- enhancement request: Implement McCallum-Relyea exchange HOT 1
- oprf: Update latest test vectors
- blindrsa: update test vectors to match RFC9474 HOT 1
- add disclaimer and warning to README about Kyber patent
- Unusual Behavior: Successful Signature Verification After Altering Private Key HOT 4
- Why were the patch versions for CVE-2023-1732 released so late? HOT 2
- does KyberSlash affect this verison of Kyber? HOT 3
- ML-DSA? HOT 2
- Implement MAYO
- cp-abe: plaintext exceeding a certain length will fail during decryption HOT 2
- kem: Scheme.DeriveKeyPair length check too strict HOT 6
- Align on `purego` build tag. HOT 1
- In ecc/bls12381, Pairing operations seems racy
- Unpacking Kyber keys from a FIPS 203 x509 key spec HOT 10
- Incorrect Documentation of Dilithium Private Key HOT 1
- Deserialization test failing for BLS12-381 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circl.