Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for StreamReader (0.23 sec)

  1. src/crypto/cipher/io.go

    // The Stream* objects are so simple that all their members are public. Users
    // can create them themselves.
    
    // StreamReader wraps a [Stream] into an [io.Reader]. It calls XORKeyStream
    // to process each slice of data which passes through.
    type StreamReader struct {
    	S Stream
    	R io.Reader
    }
    
    func (r StreamReader) Read(dst []byte) (n int, err error) {
    	n, err = r.R.Read(dst)
    	r.S.XORKeyStream(dst[:n], dst[:n])
    	return
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  2. src/net/http/roundtrip_js.go

    	}
    }
    
    var errClosed = errors.New("net/http: reader is closed")
    
    // streamReader implements an io.ReadCloser wrapper for ReadableStream.
    // See https://fetch.spec.whatwg.org/#readablestream for more information.
    type streamReader struct {
    	pending []byte
    	stream  js.Value
    	err     error // sticky read error
    }
    
    func (r *streamReader) Read(p []byte) (n int, err error) {
    	if r.err != nil {
    		return 0, r.err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  3. src/crypto/cipher/example_test.go

    	stream := cipher.NewOFB(block, iv[:])
    
    	reader := &cipher.StreamReader{S: stream, R: bReader}
    	// Copy the input to the output stream, decrypting as we go.
    	if _, err := io.Copy(os.Stdout, reader); err != nil {
    		panic(err)
    	}
    
    	// Note that this example is simplistic in that it omits any
    	// authentication of the encrypted data. If you were actually to use
    	// StreamReader in this manner, an attacker could flip arbitrary bits in
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 30 16:23:44 UTC 2018
    - 11.8K bytes
    - Viewed (0)
  4. src/crypto/ecdh/ecdh_test.go

    	benchmarkAllCurves(b, func(b *testing.B, curve ecdh.Curve) {
    		c, err := chacha20.NewUnauthenticatedCipher(make([]byte, 32), make([]byte, 12))
    		if err != nil {
    			b.Fatal(err)
    		}
    		rand := cipher.StreamReader{
    			S: c, R: zeroReader,
    		}
    
    		peerKey, err := curve.GenerateKey(rand)
    		if err != nil {
    			b.Fatal(err)
    		}
    		peerShare := peerKey.PublicKey().Bytes()
    		b.ResetTimer()
    		b.ReportAllocs()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 18K bytes
    - Viewed (0)
  5. src/crypto/ecdsa/ecdsa.go

    	if err != nil {
    		return nil, err
    	}
    
    	// Create a CSPRNG that xors a stream of zeros with
    	// the output of the AES-CTR instance.
    	const aesIV = "IV for ECDSA CTR"
    	return &cipher.StreamReader{
    		R: zeroReader,
    		S: cipher.NewCTR(block, []byte(aesIV)),
    	}, nil
    }
    
    type zr struct{}
    
    var zeroReader = zr{}
    
    // Read replaces the contents of dst with zeros. It is safe for concurrent use.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"NewCTR", Func, 0},
    		{"NewGCM", Func, 2},
    		{"NewGCMWithNonceSize", Func, 5},
    		{"NewGCMWithTagSize", Func, 11},
    		{"NewOFB", Func, 0},
    		{"Stream", Type, 0},
    		{"StreamReader", Type, 0},
    		{"StreamReader.R", Field, 0},
    		{"StreamReader.S", Field, 0},
    		{"StreamWriter", Type, 0},
    		{"StreamWriter.Err", Field, 0},
    		{"StreamWriter.S", Field, 0},
    		{"StreamWriter.W", Field, 0},
    	},
    	"crypto/des": {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  7. api/go1.txt

    pkg crypto/cipher, type Stream interface { XORKeyStream }
    pkg crypto/cipher, type Stream interface, XORKeyStream([]uint8, []uint8)
    pkg crypto/cipher, type StreamReader struct
    pkg crypto/cipher, type StreamReader struct, R io.Reader
    pkg crypto/cipher, type StreamReader struct, S Stream
    pkg crypto/cipher, type StreamWriter struct
    pkg crypto/cipher, type StreamWriter struct, Err error
    pkg crypto/cipher, type StreamWriter struct, S Stream
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top