Documentation ¶
Overview ¶
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. //////////////////////////////////////////////////////////////////////////////
Index ¶
Constants ¶
const ( // All instances of this class use a 12 byte IV and 16 byte tag AES_GCM_IV_SIZE = 12 AES_GCM_TAG_SIZE = 16 )
Variables ¶
This section is empty.
Functions ¶
func ValidateAesKeySize ¶
ValidateAesKeySize checks if the given key size is a valid AES key size.
Types ¶
type AesGcm ¶
type AesGcm struct {
Key []byte
}
AesGcm is an implementation of Aead interface.
func NewAesGcm ¶
NewAesGcm returns an AesGcm instance. The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
func (*AesGcm) Decrypt ¶
Decrypt decrypts {@code ct} with {@code aad} as the additionalauthenticated data.
func (*AesGcm) Encrypt ¶
Encrypt encrypts {@code pt} with {@code aad} as additional authenticated data. The resulting ciphertext consists of two parts: (1) the IV used for encryption and (2) the actual ciphertext.
Note: AES-GCM implementation of crypto library always returns ciphertext with 128-bit tag.