Debian Codegraph @

guile/tests/srp-base64.scm

raw
1 ;;; GnuTLS --- Guile bindings for GnuTLS.
2 ;;; Copyright (C) 2007-2025 Free Software Foundation, Inc.
3 ;;;
4 ;;; This file is part of Guile-GnuTLS.
5 ;;;
6 ;;; This program is free software: you can redistribute it and/or modify
7 ;;; it under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation, either version 3 of the License, or
9 ;;; (at your option) any later version.
10 ;;;
11 ;;; This program is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19 ;;; Written by Ludovic Courtès <[email protected]>.
20
21
22 ;;;
23 ;;; Test SRP base64 encoding and decoding.
24 ;;;
25
26 (use-modules (gnutls)
27 (gnutls build tests))
28
29 (define %message
30 "GnuTLS is free software; you can redistribute it and/or
31 modify it under the terms of the GNU Lesser General Public
32 License as published by the Free Software Foundation; either
33 version 2.1 of the License, or (at your option) any later version.")
34
35 (run-test
36 (lambda ()
37 (let ((encoded (srp-base64-encode %message)))
38 (and (string? encoded)
39 (string=? (srp-base64-decode encoded)
40 %message)))))
41
42
43 ;;; arch-tag: ea1534a5-d513-4208-9a75-54bd4710f915