Рыба проекта. Минимальная функциональность

This commit is contained in:
2026-08-03 22:22:24 +03:00
commit 8c8631ac9c
80 changed files with 10618 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
package crypto
import "io"
// KEM defines the contract for a Key Encapsulation Mechanism.
type KEM interface {
SchemeID() uint16
GenerateKeyPair(
rand io.Reader,
) (
RecipientPub,
RecipientPriv,
error,
)
Encapsulate(
pub RecipientPub,
rand io.Reader,
) (
ciphertext []byte,
sharedSecret []byte,
err error,
)
Decapsulate(
priv RecipientPriv,
ciphertext []byte,
) (
sharedSecret []byte,
err error,
)
LoadPriv(
raw []byte,
) (
RecipientPriv,
error,
)
}
// RecipientPub represents a public recipient key.
type RecipientPub interface {
SchemeID() uint16
KeyID() []byte
Raw() []byte
}
// RecipientPriv represents a private recipient key.
type RecipientPriv interface {
SchemeID() uint16
KeyID() []byte
Raw() []byte
}