mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 13:43:55 +03:00
Update modules/keying/keying.go
Typo
This commit is contained in:
parent
893c2f2d90
commit
229cb20f68
1 changed files with 5 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// Keying is a module that allows for subkeys to be determistically generated
|
||||
// from the same master key. It allows for domain seperation to take place by
|
||||
// Keying is a module that allows for subkeys to be deterministically generated
|
||||
// from the same master key. It allows for domain separation to take place by
|
||||
// using new keys for new subsystems/domains. These subkeys are provided with
|
||||
// an API to encrypt and decrypt data. The module panics if a bad interaction
|
||||
// happened, the panic should be seen as an non-recoverable error.
|
||||
|
@ -52,8 +52,8 @@ var (
|
|||
ContextTOTP Context = "totp"
|
||||
)
|
||||
|
||||
// Derive *the* key for a given context, this is a determistic function. The
|
||||
// same key will be provided for the same context.
|
||||
// Derive *the* key for a given context, this is a deterministic function.
|
||||
// The same key will be provided for the same context.
|
||||
func DeriveKey(context Context) *Key {
|
||||
if len(prk) == 0 {
|
||||
panic("keying: not initialized")
|
||||
|
@ -77,7 +77,7 @@ type Key struct {
|
|||
// Encrypts the specified plaintext with some additional data that is tied to
|
||||
// this plaintext. The additional data can be seen as the context in which the
|
||||
// data is being encrypted for, this is different than the context for which the
|
||||
// key was derrived this allows for more granuality without deriving new keys.
|
||||
// key was derived; this allows for more granularity without deriving new keys.
|
||||
// Avoid any user-generated data to be passed into the additional data. The most
|
||||
// common usage of this would be to encrypt a database field, in that case use
|
||||
// the ID and database column name as additional data. The additional data isn't
|
||||
|
|
Loading…
Reference in a new issue