type PublicKey struct {
N *big.Int // modulus
E int // public exponent
+
+ boring unsafe.Pointer
}
+ // Size returns the modulus size in bytes. Raw signatures and ciphertexts
+ // for or by this public key will have the same size.
+ func (pub *PublicKey) Size() int {
+ return (pub.N.BitLen() + 7) / 8
+ }
+
// OAEPOptions is an interface for passing options to OAEP decryption using the
// crypto.Decrypter interface.
type OAEPOptions struct {
return
}
- func (d0 *digest) Sum(in []byte) []byte {
+ func (d *digest) Sum(in []byte) []byte {
+ boringUnreachable()
- // Make a copy of d0 so that caller can keep writing and summing.
- d := *d0
- hash := d.checkSum()
+ // Make a copy of d so that caller can keep writing and summing.
+ d0 := *d
+ hash := d0.checkSum()
return append(in, hash[:]...)
}
return
}
- func (d0 *digest) Sum(in []byte) []byte {
+ func (d *digest) Sum(in []byte) []byte {
+ boring.Unreachable()
- // Make a copy of d0 so that caller can keep writing and summing.
- d := *d0
- hash := d.checkSum()
- if d.is224 {
+ // Make a copy of d so that caller can keep writing and summing.
+ d0 := *d
+ hash := d0.checkSum()
+ if d0.is224 {
return append(in, hash[:Size224]...)
}
return append(in, hash[:]...)
return
}
- func (d0 *digest) Sum(in []byte) []byte {
- if d0.function != crypto.SHA512_224 && d0.function != crypto.SHA512_256 {
+ func (d *digest) Sum(in []byte) []byte {
++ if d.function != crypto.SHA512_224 && d.function != crypto.SHA512_256 {
+ boring.Unreachable()
+ }
- // Make a copy of d0 so that caller can keep writing and summing.
- d := new(digest)
- *d = *d0
- hash := d.checkSum()
- switch d.function {
+ // Make a copy of d so that caller can keep writing and summing.
+ d0 := new(digest)
+ *d0 = *d
+ hash := d0.checkSum()
+ switch d0.function {
case crypto.SHA384:
return append(in, hash[:Size384]...)
case crypto.SHA512_224: