You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have to write a fixed-length buffer of a certain size, ensuring that we write the entire buffer. This is the case for RSA signature generation, fixed-length ECDSA signature generation, ECDH, X25519, Ed25519 signing, and other things. In this case, we may have Output::from(&mut [u8]) and then we need to ensure that every byte in the buffer is written at least once, from start to finish.
We have to write a variable-length buffer of a certain maximum length, and the writer will return how many bytes (less than or equal to the maximum) were actually written. This is the case for ASN.1 ECDSA signature generation, extracting an encoded RSA public key from a private key, and other things. Again, the interface should guarantee that every byte of the output is written at least once.
Hopefully we can define an interface with a lot of commonality between the two use cases. Maybe we'd have a write_all() that is analogous to read_all() for first first case and a write_partial() for the second case. Not sure yet.
The text was updated successfully, but these errors were encountered:
There are two concepts:
We have to write a fixed-length buffer of a certain size, ensuring that we write the entire buffer. This is the case for RSA signature generation, fixed-length ECDSA signature generation, ECDH, X25519, Ed25519 signing, and other things. In this case, we may have
Output::from(&mut [u8])
and then we need to ensure that every byte in the buffer is written at least once, from start to finish.We have to write a variable-length buffer of a certain maximum length, and the writer will return how many bytes (less than or equal to the maximum) were actually written. This is the case for ASN.1 ECDSA signature generation, extracting an encoded RSA public key from a private key, and other things. Again, the interface should guarantee that every byte of the output is written at least once.
Hopefully we can define an interface with a lot of commonality between the two use cases. Maybe we'd have a
write_all()
that is analogous toread_all()
for first first case and awrite_partial()
for the second case. Not sure yet.The text was updated successfully, but these errors were encountered: