github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/crypto/gcm.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package crypto
     4  
     5  // GCM cipher mode
     6  type gcm struct {
     7  	b BlockCipher128
     8  }
     9  
    10  // NewGCM use to create the gcm that implement Cipher interface!
    11  func NewGCM(b BlockCipher128) Cipher {
    12  	var g = gcm{
    13  		b: b,
    14  	}
    15  	return &g
    16  }
    17  
    18  // Encrypt encrypts the buf.
    19  // If original buf needed for any other proccess, must clone it before pass it!!
    20  func (g *gcm) Encrypt(buf []byte) (err error) {
    21  	return
    22  }
    23  
    24  // Decrypt decrypts the buf.
    25  // If original buf needed for any other proccess, must clone it before pass it!!
    26  func (g *gcm) Decrypt(buf []byte) (err error) {
    27  	return
    28  }