id
int64 0
45.1k
| file_name
stringlengths 4
68
| file_path
stringlengths 14
193
| content
stringlengths 32
9.62M
| size
int64 32
9.62M
| language
stringclasses 1
value | extension
stringclasses 6
values | total_lines
int64 1
136k
| avg_line_length
float64 3
903k
| max_line_length
int64 3
4.51M
| alphanum_fraction
float64 0
1
| repo_name
stringclasses 779
values | repo_stars
int64 0
882
| repo_forks
int64 0
108
| repo_open_issues
int64 0
90
| repo_license
stringclasses 8
values | repo_extraction_date
stringclasses 146
values | sha
stringlengths 64
64
| __index_level_0__
int64 0
45.1k
| exdup_ids_cmlisp_stkv2
sequencelengths 1
47
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,054 | cryptonight.lisp | glv2_cl-monero-tools/monero-tools/crypto/cryptonight.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun cryptonight (data variant height)
(declare (type (simple-array (unsigned-byte 8) (*)) data)
(type fixnum variant height)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
(when (and (= variant 1) (< (length data) 43))
(error "Cryptonight variant 1 requires at least 43 bytes of data."))
(let* ((+scratchpad-size+ #.(ash 1 21))
(+bounce-iterations+ #.(ash 1 20))
(+aes-block-size+ 16)
(+init-size-blk+ 8)
(+init-size-byte+ (* +init-size-blk+ +aes-block-size+)))
;; Step 1: Use Keccak1600 to initialize the STATE and TEXT buffers
;; from the DATA.
(let* ((state (keccak1600 data))
(text (make-array +init-size-byte+ :element-type '(unsigned-byte 8))))
(declare (type (simple-array (unsigned-byte 8) (200)) state)
(type (simple-array (unsigned-byte 8) (128)) text)
(dynamic-extent text))
(replace text state :start2 64)
;; Step 2: Iteratively encrypt the results from Keccak to fill the
;; 2MB large random access buffer.
(let ((round-keys (pseudo-aes-expand-key state 0))
(scratchpad (make-array +scratchpad-size+ :element-type '(unsigned-byte 8))))
(declare (type aes-round-keys round-keys)
(type (simple-array (unsigned-byte 8) (#.(ash 1 21))) scratchpad))
(dotimes (i (/ +scratchpad-size+ +init-size-byte+))
(dotimes (j +init-size-blk+)
(pseudo-aes-rounds text (* j +aes-block-size+) text (* j +aes-block-size+) round-keys))
(replace scratchpad text :start1 (* i +init-size-byte+)))
;; Step 3: Bounce randomly 1,048,576 times through the mixing
;; buffer, using 524,288 iterations of the following mixing
;; function. Each execution performs two reads and writes from
;; the mixing buffer.
(let ((a (make-array 16 :element-type '(unsigned-byte 8)))
(a1 (make-array 16 :element-type '(unsigned-byte 8)))
(b (make-array 32 :element-type '(unsigned-byte 8)))
(c1 (make-array 16 :element-type '(unsigned-byte 8)))
(c2 (make-array 16 :element-type '(unsigned-byte 8)))
(d (make-array 16 :element-type '(unsigned-byte 8)))
(tweak 0)
(division-result 0)
(sqrt-result 0)
(r (make-array 9 :element-type '(unsigned-byte 32)))
(random-math-function #'identity))
(declare (type (simple-array (unsigned-byte 8) (16)) a a1 c1 c2 d)
(type (simple-array (unsigned-byte 8) (32)) b)
(type (simple-array (unsigned-byte 32) (9)) r)
(dynamic-extent a b c1 c2 d r)
(type (unsigned-byte 64) tweak division-result sqrt-result)
(type function random-math-function))
(macrolet ((v1-init ()
`(when (= variant 1)
(setf tweak (logxor (ub64ref/le state 192) (ub64ref/le data 35)))))
(v1-1 ()
`(when (= variant 1)
(let* ((tmp (aref scratchpad (+ scratchpad-address 11)))
(index (logand (ash (logior (logand (ash tmp -3) 6) (logand tmp 1)) 1) #xff)))
(declare (type (unsigned-byte 8) tmp index))
(setf (aref scratchpad (+ scratchpad-address 11))
(logxor tmp (logand (ash #x75310 (- index)) #x30))))))
(v1-2 ()
`(when (= variant 1)
(setf (ub64ref/le scratchpad (+ scratchpad-address 8))
(logxor (ub64ref/le scratchpad (+ scratchpad-address 8)) tweak))))
(v2-init ()
`(when (>= variant 2)
(setf division-result (ub64ref/le state 96)
sqrt-result (ub64ref/le state 104))
(xor-block 16 state 64 state 80 b 16)))
(v2-shuffle-add (a)
`(when (>= variant 2)
(let* ((i1 (logxor scratchpad-address #x10))
(i2 (logxor scratchpad-address #x20))
(i3 (logxor scratchpad-address #x30))
(t0 (ub64ref/le scratchpad i1))
(t1 (ub64ref/le scratchpad (+ i1 8)))
(t2 (ub64ref/le scratchpad i2))
(t3 (ub64ref/le scratchpad (+ i2 8)))
(t4 (ub64ref/le scratchpad i3))
(t5 (ub64ref/le scratchpad (+ i3 8))))
(declare (type (unsigned-byte 21) i1 i2 i3)
(type (unsigned-byte 64) t0 t1 t2 t3 t4 t5))
(setf (ub64ref/le scratchpad i1) (mod64+ t4 (ub64ref/le b 16))
(ub64ref/le scratchpad (+ i1 8)) (mod64+ t5 (ub64ref/le b 24))
(ub64ref/le scratchpad i3) (mod64+ t2 (ub64ref/le ,a 0))
(ub64ref/le scratchpad (+ i3 8)) (mod64+ t3 (ub64ref/le ,a 8))
(ub64ref/le scratchpad i2) (mod64+ t0 (ub64ref/le b 0))
(ub64ref/le scratchpad (+ i2 8)) (mod64+ t1 (ub64ref/le b 8)))
(when (>= variant 4)
(setf (ub64ref/le c1 0) (logxor (ub64ref/le c1 0) t0 t2 t4)
(ub64ref/le c1 8) (logxor (ub64ref/le c1 8) t1 t3 t5))))))
(v2-integer-math ()
`(when (<= 2 variant 3)
(setf (ub64ref/le c2 0) (logxor (ub64ref/le c2 0)
division-result
(mod64ash sqrt-result 32)))
(let ((dividend (ub64ref/le c1 8))
(divisor (logior #x80000001
(logand #xffffffff
(mod64+ (ub64ref/le c1 0)
(logand #xffffffff
(mod64ash sqrt-result 1)))))))
(declare (type (unsigned-byte 64) dividend)
(type (unsigned-byte 32) divisor))
(multiple-value-bind (q r) (truncate dividend divisor)
(declare (type (unsigned-byte 64) q r))
(setf division-result (mod64+ (logand q #xffffffff) (mod64ash r 32))))
(let* ((sqrt-input (mod64+ (ub64ref/le c1 0) division-result))
(t0 (logand sqrt-input #xffffffff))
(t1 (ash sqrt-input -32)))
(declare (type (unsigned-byte 64) sqrt-input)
(type (unsigned-byte 32) t0 t1))
;; On SBCL x86-64, converting sqrt-input to a double-float
;; conses a bignum, which slows down the loop a lot.
;; Separating it in two parts and making conversions of
;; smaller integers solves this problem.
(setf sqrt-result (floor (- (* 2.0d0 (sqrt (+ t0 (* t1 4294967296.0d0)
18446744073709551616.0d0)))
8589934592.0d0)))
(let* ((s (ash sqrt-result -1))
(b (logand sqrt-result 1))
(r (mod64+ (mod64* s (mod64+ s b)) (mod64ash sqrt-result 32))))
(declare (type (unsigned-byte 64) s b r))
(when (> (mod64+ r b) sqrt-input)
(decf sqrt-result))
(when (< (mod64+ r #.(ash 1 32)) (mod64- sqrt-input s))
(incf sqrt-result)))))))
(v2-2 ()
`(when (<= 2 variant 3)
(let ((i1 (logxor scratchpad-address #x10))
(i2 (logxor scratchpad-address #x20)))
(declare (type (unsigned-byte 21) i1 i2))
(xor-block 16 d 0 scratchpad i1 scratchpad i1)
(xor-block 16 d 0 scratchpad i2 d 0))))
(v4-init ()
`(when (>= variant 4)
(dotimes (i 4)
(setf (aref r i) (ub32ref/le state (+ 96 (* i 4)))))
(setf random-math-function (generate-random-math-function height))))
(v4-random-math ()
`(when (>= variant 4)
(setf (ub64ref/le c2 0) (logxor (ub64ref/le c2 0)
(logior (mod32+ (aref r 0) (aref r 1))
(mod64ash (mod32+ (aref r 2) (aref r 3)) 32))))
(setf (aref r 4) (ub32ref/le a 0)
(aref r 5) (ub32ref/le a 8)
(aref r 6) (ub32ref/le b 0)
(aref r 7) (ub32ref/le b 16)
(aref r 8) (ub32ref/le b 24))
(funcall random-math-function r)
(setf (ub64ref/le a 0) (logxor (ub64ref/le a 0)
(logior (aref r 2)
(mod64ash (aref r 3) 32)))
(ub64ref/le a 8) (logxor (ub64ref/le a 8)
(logior (aref r 0)
(mod64ash (aref r 1) 32)))))))
(xor-block 16 state 0 state 32 a 0)
(xor-block 16 state 16 state 48 b 0)
(v1-init)
(v2-init)
(v4-init)
(dotimes (i (/ +bounce-iterations+ 2))
;; Iteration 1
(let ((scratchpad-address (logand (ub32ref/le a 0) #x1ffff0)))
(declare (type (unsigned-byte 21) scratchpad-address))
(copy-block 16 scratchpad scratchpad-address c1 0)
(pseudo-aes-round c1 0 c1 0 a)
(v2-shuffle-add a)
(xor-block 16 b 0 c1 0 scratchpad scratchpad-address)
(v1-1)
;; Iteration 2
(setf scratchpad-address (logand (ub32ref/le c1 0) #x1ffff0))
(copy-block 16 scratchpad scratchpad-address c2 0)
(copy-block 16 a 0 a1 0)
(v2-integer-math)
(v4-random-math)
(let* ((t0 (* (ub32ref/le c1 0) (ub32ref/le c2 0)))
(t1 (* (ub32ref/le c1 0) (ub32ref/le c2 4)))
(t2 (* (ub32ref/le c1 4) (ub32ref/le c2 0)))
(t3 (* (ub32ref/le c1 4) (ub32ref/le c2 4)))
(carry (+ (ash t0 -32) (logand t1 #xffffffff) (logand t2 #xffffffff)))
(s0 (logior (logand t0 #xffffffff) (mod64ash carry 32)))
(carry (+ (ash carry -32) (ash t1 -32) (ash t2 -32)))
(s1 (mod64+ t3 carry)))
(declare (type (unsigned-byte 64) t0 t1 t2 t3 s0 s1 carry))
(setf (ub64ref/le d 0) s1)
(setf (ub64ref/le d 8) s0))
(v2-2)
(v2-shuffle-add a1)
(setf (ub64ref/le a 0) (mod64+ (ub64ref/le a 0) (ub64ref/le d 0)))
(setf (ub64ref/le a 8) (mod64+ (ub64ref/le a 8) (ub64ref/le d 8)))
(copy-block 16 a 0 scratchpad scratchpad-address)
(xor-block 16 a 0 c2 0 a 0)
(v1-2)
(when (>= variant 2)
(copy-block 16 b 0 b 16))
(copy-block 16 c1 0 b 0)))))
;; Step 4: Sequentially pass through the mixing buffer and use
;; 10 rounds of AES encryption to mix the random data back into
;; the TEXT buffer. TEXT was originally created with the output
;; of Keccak1600.
(replace text state :start2 64)
(setf round-keys (pseudo-aes-expand-key state 32))
(dotimes (i (/ +scratchpad-size+ +init-size-byte+))
(dotimes (j +init-size-blk+)
(xor-block 16 text (* j +aes-block-size+)
scratchpad (+ (* i +init-size-byte+) (* j +aes-block-size+))
text (* j +aes-block-size+))
(pseudo-aes-rounds text (* j +aes-block-size+) text (* j +aes-block-size+) round-keys)))
;; Step 5: Apply Keccak to the state again, and then use the
;; resulting data to select which of four finalizer hash
;; functions to apply to the data (Blake, Groestl, JH, or
;; Skein). Use this hash to squeeze the state array down to the
;; final 256 bit hash output.
(replace state text :start1 64)
(let ((state-64 (make-array 25 :element-type '(unsigned-byte 64))))
(declare (type (simple-array (unsigned-byte 64) (25)) state-64)
(dynamic-extent state-64))
(dotimes (i 25)
(setf (aref state-64 i) (ub64ref/le state (* 8 i))))
(keccakf state-64)
(dotimes (i 25)
(setf (ub64ref/le state (* 8 i)) (aref state-64 i))))
(digest-sequence (case (logand (aref state 0) 3)
((0) :blake256)
((1) :groestl/256)
((2) :jh/256)
((3) :skein512/256))
state)))))
| 14,540 | Common Lisp | .lisp | 234 | 39.183761 | 113 | 0.446022 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 04d6cc80c19f794c559cafbd80207256a896964f3ff0d65bb0fb336250ddd3c9 | 8,054 | [
-1
] |
8,055 | asm-sbcl-x86-64.lisp | glv2_cl-monero-tools/monero-tools/crypto/asm-sbcl-x86-64.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
#+(and sbcl x86-64)
(defpackage :monero-tools-vm
(:use :cl :sb-c :sb-assem :sb-vm)
(:shadow #:ea)
(:import-from :sb-vm
#:descriptor-reg
#:double-reg
#:unsigned-reg
#:unsigned-num
#:simple-array-unsigned-byte-8
#:simple-array-unsigned-byte-32))
#+(and sbcl x86-64)
(in-package :monero-tools-vm)
#+(and sbcl x86-64)
(eval-when (:compile-toplevel :load-toplevel :execute)
;; Newer SBCL (>= 1.4.11)
#+ironclad-sb-vm-ea
(setf (fdefinition 'ea) (fdefinition 'sb-vm::ea))
;; Older SBCL (< 1.4.11)
#-ironclad-sb-vm-ea
(defun ea (displacement &optional base index (scale 1))
(sb-vm::make-ea :qword
:base base
:index index
:scale scale
:disp (or displacement 0)))
(when (crypto::aes-ni-supported-p)
(pushnew :aes-ni *features*)))
#+(and sbcl x86-64 aes-ni)
(defknown monero-tools::pseudo-aes-expand-key/aes-ni
((simple-array (unsigned-byte 8) (*))
(simple-array (unsigned-byte 32) (*)))
(values)
(any)
:overwrite-fndb-silently t)
#+(and sbcl x86-64 aes-ni)
(define-vop (pseudo-aes-expand-key/aes-ni)
(:translate monero-tools::pseudo-aes-expand-key/aes-ni)
(:policy :fast-safe)
(:args (key :scs (descriptor-reg))
(encryption-keys :scs (descriptor-reg)))
(:arg-types simple-array-unsigned-byte-8
simple-array-unsigned-byte-32)
(:temporary (:sc double-reg) x0 x1 x2 x3)
(:generator 1000
(flet ((buffer-mem (base i)
(let ((disp (+ (- (* n-word-bytes vector-data-offset)
other-pointer-lowtag)
(* 16 i))))
(ea disp base)))
(expand-key-256a ()
(inst pshufd x1 x1 #b11111111)
(inst shufps x2 x0 #b00010000)
(inst pxor x0 x2)
(inst shufps x2 x0 #b10001100)
(inst pxor x0 x2)
(inst pxor x0 x1))
(expand-key-256b ()
(inst pshufd x1 x1 #b10101010)
(inst shufps x2 x3 #b00010000)
(inst pxor x3 x2)
(inst shufps x2 x3 #b10001100)
(inst pxor x3 x2)
(inst pxor x3 x1)))
(inst pxor x2 x2)
(inst movdqu x0 (buffer-mem key 0))
(inst movdqu x3 (buffer-mem key 1))
(inst movdqu (buffer-mem encryption-keys 0) x0)
(inst movdqu (buffer-mem encryption-keys 1) x3)
(inst aeskeygenassist x1 x3 1)
(expand-key-256a)
(inst movdqu (buffer-mem encryption-keys 2) x0)
(inst aeskeygenassist x1 x0 1)
(expand-key-256b)
(inst movdqu (buffer-mem encryption-keys 3) x3)
(inst aeskeygenassist x1 x3 2)
(expand-key-256a)
(inst movdqu (buffer-mem encryption-keys 4) x0)
(inst aeskeygenassist x1 x0 2)
(expand-key-256b)
(inst movdqu (buffer-mem encryption-keys 5) x3)
(inst aeskeygenassist x1 x3 4)
(expand-key-256a)
(inst movdqu (buffer-mem encryption-keys 6) x0)
(inst aeskeygenassist x1 x0 4)
(expand-key-256b)
(inst movdqu (buffer-mem encryption-keys 7) x3)
(inst aeskeygenassist x1 x3 8)
(expand-key-256a)
(inst movdqu (buffer-mem encryption-keys 8) x0)
(inst aeskeygenassist x1 x0 8)
(expand-key-256b)
(inst movdqu (buffer-mem encryption-keys 9) x3))))
#+(and sbcl x86-64 aes-ni)
(defknown monero-tools::pseudo-aes-round/aes-ni
((simple-array (unsigned-byte 8) (*))
(unsigned-byte 32)
(simple-array (unsigned-byte 8) (*))
(unsigned-byte 32)
(simple-array (unsigned-byte 8) (*)))
(values)
(any)
:overwrite-fndb-silently t)
#+(and sbcl x86-64 aes-ni)
(define-vop (pseudo-aes-round/aes-ni)
(:translate monero-tools::pseudo-aes-round/aes-ni)
(:policy :fast-safe)
(:args (in :scs (descriptor-reg))
(in-start :scs (unsigned-reg))
(out :scs (descriptor-reg))
(out-start :scs (unsigned-reg))
(round-key :scs (descriptor-reg)))
(:arg-types simple-array-unsigned-byte-8
unsigned-num
simple-array-unsigned-byte-8
unsigned-num
simple-array-unsigned-byte-8)
(:temporary (:sc double-reg) x0 x1)
(:generator 1000
(let ((disp (- (* n-word-bytes vector-data-offset)
other-pointer-lowtag)))
(flet ((buffer-mem (base offset)
(ea disp base offset))
(round-key ()
(ea disp round-key)))
(inst movdqu x0 (buffer-mem in in-start))
(inst movdqu x1 (round-key))
(inst aesenc x0 x1)
(inst movdqu (buffer-mem out out-start) x0)))))
#+(and sbcl x86-64 aes-ni)
(defknown monero-tools::pseudo-aes-rounds/aes-ni
((simple-array (unsigned-byte 8) (*))
(unsigned-byte 32)
(simple-array (unsigned-byte 8) (*))
(unsigned-byte 32)
(simple-array (unsigned-byte 32) (*)))
(values)
(any)
:overwrite-fndb-silently t)
#+(and sbcl x86-64 aes-ni)
(define-vop (pseudo-aes-rounds/aes-ni)
(:translate monero-tools::pseudo-aes-rounds/aes-ni)
(:policy :fast-safe)
(:args (in :scs (descriptor-reg))
(in-start :scs (unsigned-reg))
(out :scs (descriptor-reg))
(out-start :scs (unsigned-reg))
(round-keys :scs (descriptor-reg)))
(:arg-types simple-array-unsigned-byte-8
unsigned-num
simple-array-unsigned-byte-8
unsigned-num
simple-array-unsigned-byte-32)
(:temporary (:sc double-reg) x0 x1)
(:generator 1000
(flet ((buffer-mem (base offset)
(let ((disp (- (* n-word-bytes vector-data-offset)
other-pointer-lowtag)))
(ea disp base offset)))
(round-key (i)
(let ((disp (+ (- (* n-word-bytes vector-data-offset)
other-pointer-lowtag)
(* 16 i))))
(ea disp round-keys))))
(inst movdqu x0 (buffer-mem in in-start))
(inst movdqu x1 (round-key 0))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 1))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 2))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 3))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 4))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 5))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 6))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 7))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 8))
(inst aesenc x0 x1)
(inst movdqu x1 (round-key 9))
(inst aesenc x0 x1)
(inst movdqu (buffer-mem out out-start) x0))))
| 6,904 | Common Lisp | .lisp | 190 | 28.257895 | 66 | 0.584726 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 8273dceb55ddb65dd5a973ffb93f540886fda7d86a8952beb0894e144b24b086 | 8,055 | [
-1
] |
8,056 | blake.lisp | glv2_cl-monero-tools/monero-tools/crypto/blake.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :crypto)
;;;
;;; Parameters
;;;
(eval-when (:compile-toplevel :load-toplevel :execute)
(defconstant +blake256-rounds+ 14)
(defconstant +blake256-block-size+ 64)
(defconst +blake256-sigma+
(make-array '(14 16)
:element-type '(integer 0 15)
:initial-contents '((0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(14 10 4 8 9 15 13 6 1 12 0 2 11 7 5 3)
(11 8 12 0 5 2 15 13 10 14 3 6 7 1 9 4)
(7 9 3 1 13 12 11 14 2 6 5 10 4 0 15 8)
(9 0 5 7 2 4 10 15 14 1 11 12 6 8 3 13)
(2 12 6 10 0 11 8 3 4 13 7 5 15 14 1 9)
(12 5 1 15 14 13 4 10 0 7 6 3 9 2 8 11)
(13 11 7 14 12 1 3 9 5 0 15 4 8 6 2 10)
(6 15 14 9 11 3 0 8 12 2 13 7 1 4 10 5)
(10 2 8 4 7 6 1 5 15 11 9 14 3 12 13 0)
(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(14 10 4 8 9 15 13 6 1 12 0 2 11 7 5 3)
(11 8 12 0 5 2 15 13 10 14 3 6 7 1 9 4)
(7 9 3 1 13 12 11 14 2 6 5 10 4 0 15 8))))
(defconst +blake256-cst+
(make-array 16
:element-type '(unsigned-byte 32)
:initial-contents '(#x243f6a88 #x85a308d3 #x13198a2e #x03707344
#xa4093822 #x299f31d0 #x082efa98 #xec4e6c89
#x452821e6 #x38d01377 #xbe5466cf #x34e90c6c
#xc0ac29b7 #xc97c50dd #x3f84d5b5 #xb5470917)))
(defconst +blake256-padding-a+
(make-array 1 :element-type '(unsigned-byte 8) :initial-contents '(#x81)))
(defconst +blake256-padding-b+
(make-array 1 :element-type '(unsigned-byte 8) :initial-contents '(#x01)))
(defconst +blake256-padding+
(make-array 64
:element-type '(unsigned-byte 8)
:initial-contents '(#x80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))))
;;;
;;; Blake256 rounds
;;;
#+sbcl
(eval-when (:compile-toplevel)
(setf sb-ext:*inline-expansion-limit* (max sb-ext:*inline-expansion-limit* 1000)))
(declaim (ftype (function ((simple-array (unsigned-byte 32) (8))
(simple-array (unsigned-byte 32) (4))
(simple-array (unsigned-byte 32) (2))
(simple-array (unsigned-byte 8) (*))
fixnum
boolean))
blake256-rounds))
(defun blake256-rounds (state-h state-s state-t input start nullt)
(declare (type (simple-array (unsigned-byte 32) (8)) state-h)
(type (simple-array (unsigned-byte 32) (4)) state-s)
(type (simple-array (unsigned-byte 32) (2)) state-t)
(type (simple-array (unsigned-byte 8) (*)) input)
(type fixnum start)
(type boolean nullt)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
(let ((v0 (aref state-h 0))
(v1 (aref state-h 1))
(v2 (aref state-h 2))
(v3 (aref state-h 3))
(v4 (aref state-h 4))
(v5 (aref state-h 5))
(v6 (aref state-h 6))
(v7 (aref state-h 7))
(v8 (logxor (aref state-s 0) #x243f6a88))
(v9 (logxor (aref state-s 1) #x85a308d3))
(v10 (logxor (aref state-s 2) #x13198a2e))
(v11 (logxor (aref state-s 3) #x03707344))
(v12 #xa4093822)
(v13 #x299f31d0)
(v14 #x082efa98)
(v15 #xec4e6c89)
(m (make-array 16 :element-type '(unsigned-byte 32) :initial-element 0)))
(declare (type (unsigned-byte 32) v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15)
(type (simple-array (unsigned-byte 32) (16)) m)
(dynamic-extent m))
(unless nullt
(setf v12 (logxor v12 (aref state-t 0))
v13 (logxor v13 (aref state-t 0))
v14 (logxor v14 (aref state-t 1))
v15 (logxor v15 (aref state-t 1))))
;; Get input data as 32-bit big-endian integers
(dotimes-unrolled (i 16)
(setf (aref m i) (ub32ref/be input (+ start (* i 4)))))
;; Mixing rounds
(macrolet ((blake256-mixing (va vb vc vd e)
`(setf ,va (mod32+ (mod32+ ,va ,vb)
(logxor (aref m (aref +blake256-sigma+ i ,e))
(aref +blake256-cst+ (aref +blake256-sigma+ i (1+ ,e)))))
,vd (ror32 (logxor ,vd ,va) 16)
,vc (mod32+ ,vc ,vd)
,vb (ror32 (logxor ,vb ,vc) 12)
,va (mod32+ (mod32+ ,va ,vb)
(logxor (aref m (aref +blake256-sigma+ i (1+ ,e)))
(aref +blake256-cst+ (aref +blake256-sigma+ i ,e))))
,vd (ror32 (logxor ,vd ,va) 8)
,vc (mod32+ ,vc ,vd)
,vb (ror32 (logxor ,vb ,vc) 7))))
(dotimes-unrolled (i +blake256-rounds+)
(blake256-mixing v0 v4 v8 v12 0)
(blake256-mixing v1 v5 v9 v13 2)
(blake256-mixing v2 v6 v10 v14 4)
(blake256-mixing v3 v7 v11 v15 6)
(blake256-mixing v3 v4 v9 v14 14)
(blake256-mixing v2 v7 v8 v13 12)
(blake256-mixing v0 v5 v10 v15 8)
(blake256-mixing v1 v6 v11 v12 10)))
;; Compute new state
(setf (aref state-h 0) (logxor (aref state-h 0) v0 v8 (aref state-s 0))
(aref state-h 1) (logxor (aref state-h 1) v1 v9 (aref state-s 1))
(aref state-h 2) (logxor (aref state-h 2) v2 v10 (aref state-s 2))
(aref state-h 3) (logxor (aref state-h 3) v3 v11 (aref state-s 3))
(aref state-h 4) (logxor (aref state-h 4) v4 v12 (aref state-s 0))
(aref state-h 5) (logxor (aref state-h 5) v5 v13 (aref state-s 1))
(aref state-h 6) (logxor (aref state-h 6) v6 v14 (aref state-s 2))
(aref state-h 7) (logxor (aref state-h 7) v7 v15 (aref state-s 3))))
(values))
;;;
;;; Digest structures and functions
;;;
(defstruct (blake256
(:constructor %make-blake256-digest nil)
(:copier nil))
(state-h (make-array 8
:element-type '(unsigned-byte 32)
:initial-contents '(#x6a09e667 #xbb67ae85
#x3c6ef372 #xa54ff53a
#x510e527f #x9b05688c
#x1f83d9ab #x5be0cd19))
:type (simple-array (unsigned-byte 32) (8)))
(state-s (make-array 4 :element-type '(unsigned-byte 32) :initial-element 0)
:type (simple-array (unsigned-byte 32) (4)))
(state-t (make-array 2 :element-type '(unsigned-byte 32) :initial-element 0)
:type (simple-array (unsigned-byte 32) (2)))
(nullt nil :type boolean)
(buffer (make-array 64 :element-type '(unsigned-byte 8) :initial-element 0)
:type (simple-array (unsigned-byte 8) (64)))
(buffer-index 0 :type (integer 0 64)))
(defmethod reinitialize-instance ((state blake256) &rest initargs)
(declare (ignore initargs))
(setf (aref (blake256-state-h state) 0) #x6a09e667
(aref (blake256-state-h state) 1) #xbb67ae85
(aref (blake256-state-h state) 2) #x3c6ef372
(aref (blake256-state-h state) 3) #xa54ff53a
(aref (blake256-state-h state) 4) #x510e527f
(aref (blake256-state-h state) 5) #x9b05688c
(aref (blake256-state-h state) 6) #x1f83d9ab
(aref (blake256-state-h state) 7) #x5be0cd19
(blake256-nullt state) nil
(blake256-buffer-index state) 0)
(fill (blake256-state-s state) 0)
(fill (blake256-state-t state) 0)
state)
(defmethod copy-digest ((state blake256) &optional copy)
(declare (type (or null blake256) copy))
(let ((copy (if copy
copy
(%make-blake256-digest))))
(declare (type blake256 copy))
(replace (blake256-state-h copy) (blake256-state-h state))
(replace (blake256-state-s copy) (blake256-state-s state))
(replace (blake256-state-t copy) (blake256-state-t state))
(replace (blake256-buffer copy) (blake256-buffer state))
(setf (blake256-nullt copy) (blake256-nullt state)
(blake256-buffer-index copy) (blake256-buffer-index state))
copy))
(defun blake256-update (state input start end)
(declare (type blake256 state)
(type (simple-array (unsigned-byte 8) (*)) input)
(type fixnum start end)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
(let* ((blake256-state-h (blake256-state-h state))
(blake256-state-s (blake256-state-s state))
(blake256-state-t (blake256-state-t state))
(nullt (blake256-nullt state))
(buffer (blake256-buffer state))
(buffer-index (blake256-buffer-index state))
(length (- end start))
(free (- +blake256-block-size+ buffer-index)))
(declare (type (simple-array (unsigned-byte 32) (8)) blake256-state-h)
(type (simple-array (unsigned-byte 32) (4)) blake256-state-s)
(type (simple-array (unsigned-byte 32) (2)) blake256-state-t)
(type (simple-array (unsigned-byte 8) (64)) buffer)
(type (integer 0 64) buffer-index free)
(type fixnum length))
;; Try to process the data in buffer
(when (and (plusp buffer-index) (>= length free))
(replace buffer input :start1 buffer-index :end1 +blake256-block-size+ :start2 start)
(setf (aref blake256-state-t 0) (mod32+ (aref blake256-state-t 0)
(* 8 +blake256-block-size+)))
(when (zerop (aref blake256-state-t 0))
(setf (aref blake256-state-t 1) (mod32+ (aref blake256-state-t 1) 1)))
(blake256-rounds blake256-state-h blake256-state-s blake256-state-t buffer 0 nullt)
(incf start free)
(decf length free)
(setf buffer-index 0))
;; Process data in message
(loop until (< length +blake256-block-size+) do
(setf (aref blake256-state-t 0) (mod32+ (aref blake256-state-t 0)
(* 8 +blake256-block-size+)))
(when (zerop (aref blake256-state-t 0))
(setf (aref blake256-state-t 1) (mod32+ (aref blake256-state-t 1) 1)))
(blake256-rounds blake256-state-h blake256-state-s blake256-state-t input start nullt)
(incf start +blake256-block-size+)
(decf length +blake256-block-size+))
;; Put remaining message data in buffer
(when (plusp length)
(replace buffer input :start1 buffer-index :end1 (+ buffer-index length) :start2 start)
(incf buffer-index length))
;; Save the new state
(setf (blake256-buffer-index state) buffer-index)
(values)))
(defun blake256-finalize (state digest digest-start)
(let* ((digest-length (digest-length state))
(blake256-state-h (blake256-state-h state))
(blake256-state-t (blake256-state-t state))
(buffer-index (blake256-buffer-index state))
(buffer-bit-length (* 8 buffer-index))
(lo (mod32+ (aref blake256-state-t 0) buffer-bit-length))
(hi (aref blake256-state-t 1))
(message-length (make-array 8 :element-type '(unsigned-byte 8))))
;; Process remaining data after padding it
(when (< lo buffer-bit-length)
(setf hi (mod32+ hi 1)))
(setf (ub32ref/be message-length 0) hi
(ub32ref/be message-length 4) lo)
(if (= buffer-index 55)
(progn
(setf (aref blake256-state-t 0) (mod32- (aref blake256-state-t 0) 8))
(blake256-update state +blake256-padding-a+ 0 1))
(progn
(if (< buffer-index 55)
(progn
(when (zerop buffer-index)
(setf (blake256-nullt state) t))
(setf (aref blake256-state-t 0) (mod32- (aref blake256-state-t 0)
(- 440 buffer-bit-length)))
(blake256-update state +blake256-padding+ 0 (- 55 buffer-index)))
(progn
(setf (aref blake256-state-t 0) (mod32- (aref blake256-state-t 0)
(- 512 buffer-bit-length)))
(blake256-update state +blake256-padding+ 0 (- 64 buffer-index))
(setf (aref blake256-state-t 0) (mod32- (aref blake256-state-t 0) 440))
(blake256-update state +blake256-padding+ 1 55)
(setf (blake256-nullt state) t)))
(blake256-update state +blake256-padding-b+ 0 1)
(setf (aref blake256-state-t 0) (mod32- (aref blake256-state-t 0) 8))))
(setf (aref blake256-state-t 0) (mod32- (aref blake256-state-t 0) 64))
(blake256-update state message-length 0 8)
;; Get output
(let ((output (make-array digest-length :element-type '(unsigned-byte 8))))
(dotimes (i 8)
(dotimes (j 4)
(setf (aref output (+ (* i 4) j)) (ldb (byte 8 (- 24 (* j 8))) (aref blake256-state-h i)))))
(replace digest output :start1 digest-start :end2 digest-length)
digest)))
(define-digest-updater blake256
(blake256-update state sequence start end))
(define-digest-finalizer (blake256 32)
(blake256-finalize state digest digest-start))
(defdigest blake256 :digest-length 32 :block-length 64)
(export 'blake256)
| 13,969 | Common Lisp | .lisp | 273 | 38.732601 | 102 | 0.55297 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | f8ece377c0045e57c450d9724aff7792540e95bc1aa2d9ed8a54552fb15bc248 | 8,056 | [
-1
] |
8,057 | pseudo-aes.lisp | glv2_cl-monero-tools/monero-tools/crypto/pseudo-aes.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun pseudo-aes-expand-key (state state-start)
(declare (type (simple-array (unsigned-byte 8) (*)) state)
(type fixnum state-start)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
(let* ((key (make-array 32 :element-type '(unsigned-byte 8)))
(encryption-keys (allocate-round-keys key)))
(declare (type (simple-array (unsigned-byte 8) (32)) key)
(type aes-round-keys encryption-keys)
(dynamic-extent key))
(replace key state :start2 state-start)
#+(and sbcl x86-64 aes-ni)
(pseudo-aes-expand-key/aes-ni key encryption-keys)
#-(and sbcl x86-64 aes-ni)
(generate-round-keys-for-encryption key encryption-keys)
encryption-keys))
(macrolet ((rk-ref (x)
`(aref round-keys ,x))
(mix (rk a0 a1 a2 a3 sym0 sym1 sym2 sym3)
`(logxor (aref ,a0 (fourth-byte ,sym0))
(aref ,a1 (third-byte ,sym1))
(aref ,a2 (second-byte ,sym2))
(aref ,a3 (first-byte ,sym3))
(rk-ref ,rk)))
(mix-s-into-t-encrypting (offset)
`(setf t0 (mix ,offset Te0 Te1 Te2 Te3 s0 s1 s2 s3)
t1 (mix ,(1+ offset) Te0 Te1 Te2 Te3 s1 s2 s3 s0)
t2 (mix ,(+ offset 2) Te0 Te1 Te2 Te3 s2 s3 s0 s1)
t3 (mix ,(+ offset 3) Te0 Te1 Te2 Te3 s3 s0 s1 s2)))
(mix-t-into-s-encrypting (offset)
`(setf s0 (mix ,offset Te0 Te1 Te2 Te3 t0 t1 t2 t3)
s1 (mix ,(1+ offset) Te0 Te1 Te2 Te3 t1 t2 t3 t0)
s2 (mix ,(+ offset 2) Te0 Te1 Te2 Te3 t2 t3 t0 t1)
s3 (mix ,(+ offset 3) Te0 Te1 Te2 Te3 t3 t0 t1 t2))))
(defun pseudo-aes-round (in in-start out out-start round-key)
(declare (type (simple-array (unsigned-byte 8) (*)) in out)
(type (simple-array (unsigned-byte 8) (16)) round-key)
(type (unsigned-byte 32) in-start out-start)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
#+(and sbcl x86-64 aes-ni)
(pseudo-aes-round/aes-ni in in-start out out-start round-key)
#-(and sbcl x86-64 aes-ni)
(let ((round-keys (make-array 4 :element-type '(unsigned-byte 32))))
(declare (type (simple-array (unsigned-byte 32) (4)) round-keys)
(dynamic-extent round-keys))
(setf (aref round-keys 0) (ub32ref/be round-key 0))
(setf (aref round-keys 1) (ub32ref/be round-key 4))
(setf (aref round-keys 2) (ub32ref/be round-key 8))
(setf (aref round-keys 3) (ub32ref/be round-key 12))
(with-words ((s0 s1 s2 s3) in in-start)
(let ((t0 0) (t1 0) (t2 0) (t3 0))
(declare (type (unsigned-byte 32) t0 t1 t2 t3))
(mix-s-into-t-encrypting 0)
(store-words out out-start t0 t1 t2 t3)))))
(defun pseudo-aes-rounds (in in-start out out-start round-keys)
(declare (type (simple-array (unsigned-byte 8) (*)) in out)
(type aes-round-keys round-keys)
(type (unsigned-byte 32) in-start out-start)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
#+(and sbcl x86-64 aes-ni)
(pseudo-aes-rounds/aes-ni in in-start out out-start round-keys)
#-(and sbcl x86-64 aes-ni)
(with-words ((s0 s1 s2 s3) in in-start)
(let ((t0 0) (t1 0) (t2 0) (t3 0))
(declare (type (unsigned-byte 32) t0 t1 t2 t3))
(mix-s-into-t-encrypting 0)
(mix-t-into-s-encrypting 4)
(mix-s-into-t-encrypting 8)
(mix-t-into-s-encrypting 12)
(mix-s-into-t-encrypting 16)
(mix-t-into-s-encrypting 20)
(mix-s-into-t-encrypting 24)
(mix-t-into-s-encrypting 28)
(mix-s-into-t-encrypting 32)
(mix-t-into-s-encrypting 36)
(store-words out out-start s0 s1 s2 s3)))))
| 4,050 | Common Lisp | .lisp | 80 | 40.8625 | 73 | 0.581231 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 2ce6109c46ddd19e4733d10aaca1c99ff67ff369829cc8c9a13f1e8c05f6b3ea | 8,057 | [
-1
] |
8,058 | keccak.lisp | glv2_cl-monero-tools/monero-tools/crypto/keccak.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(eval-when (:compile-toplevel :load-toplevel :execute)
(define-constant +keccakf-rndc+
(make-array 24
:element-type '(unsigned-byte 64)
:initial-contents '(#x0000000000000001 #x0000000000008082
#x800000000000808a #x8000000080008000
#x000000000000808b #x0000000080000001
#x8000000080008081 #x8000000000008009
#x000000000000008a #x0000000000000088
#x0000000080008009 #x000000008000000a
#x000000008000808b #x800000000000008b
#x8000000000008089 #x8000000000008003
#x8000000000008002 #x8000000000000080
#x000000000000800a #x800000008000000a
#x8000000080008081 #x8000000000008080
#x0000000080000001 #x8000000080008008))
:test #'equalp)
(define-constant +keccakf-rotc+
(make-array 24
:element-type '(unsigned-byte 6)
:initial-contents '(1 3 6 10 15 21 28 36
45 55 2 14 27 41 56 8
25 43 62 18 39 61 20 44))
:test #'equalp)
(define-constant +keccakf-piln+
(make-array 24
:element-type '(unsigned-byte 5)
:initial-contents '(10 7 11 17 18 3 5 16
8 21 24 4 15 23 19 13
12 2 20 14 22 9 6 1))
:test #'equalp))
(defun keccakf (state)
(declare (type (simple-array (unsigned-byte 64) (25)) state)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
(let ((rndc (load-time-value +keccakf-rndc+ t))
(rotc (load-time-value +keccakf-rotc+ t))
(piln (load-time-value +keccakf-piln+ t))
(t1 0)
(t2 0)
(bc (make-array 5 :element-type '(unsigned-byte 64))))
(declare (type (simple-array (unsigned-byte 64) (24)) rndc)
(type (simple-array (unsigned-byte 6) (24)) rotc)
(type (simple-array (unsigned-byte 5) (24)) piln)
(type (unsigned-byte 64) t1 t2)
(type (simple-array (unsigned-byte 64) (5)) bc)
(dynamic-extent bc))
(dotimes (round 24)
;; Theta
(dotimes-unrolled (i 5)
(setf (aref bc i) (logxor (aref state i)
(aref state (+ i 5))
(aref state (+ i 10))
(aref state (+ i 15))
(aref state (+ i 20)))))
(dotimes-unrolled (i 5)
(setf t1 (logxor (aref bc (mod (+ i 4) 5))
(rol64 (aref bc (mod (+ i 1) 5)) 1)))
(dotimes-unrolled (j 5)
(setf (aref state (+ i (* j 5))) (logxor (aref state (+ i (* j 5))) t1))))
;; Rho Pi
(setf t1 (aref state 1))
(dotimes-unrolled (i 24)
(setf t2 (aref piln i))
(setf (aref bc 0) (aref state t2))
(setf (aref state t2) (rol64 t1 (aref rotc i)))
(setf t1 (aref bc 0)))
;; Chi
(dotimes-unrolled (j 5)
(dotimes-unrolled (i 5)
(setf (aref bc i) (aref state (+ i (* j 5)))))
(dotimes-unrolled (i 5)
(setf (aref state (+ i (* j 5))) (logxor (aref state (+ i (* j 5)))
(logand (mod64lognot (aref bc (mod (+ i 1) 5)))
(aref bc (mod (+ i 2) 5)))))))
;; Iota
(setf (aref state 0) (logxor (aref state 0) (aref rndc round))))))
(defun keccak1600 (data)
(declare (type (simple-array (unsigned-byte 8) (*)) data)
(optimize (speed 3) (space 0) (safety 0) (debug 0)))
(let* ((data-length (length data))
(start 0)
(state (make-array 25 :element-type '(unsigned-byte 64) :initial-element 0))
(tmp (make-array 144 :element-type '(unsigned-byte 8))))
(declare (type fixnum data-length start)
(type (simple-array (unsigned-byte 64) (25)) state)
(type (simple-array (unsigned-byte 8) (144)) tmp)
(dynamic-extent state tmp))
(iter (until (< data-length 136))
(dotimes-unrolled (i 17)
(setf (aref state i) (logxor (aref state i) (ub64ref/le data start)))
(incf start 8))
(decf data-length 136)
(keccakf state))
;; Last block and padding
(replace tmp data :end1 data-length :start2 start)
(setf (aref tmp data-length) 1)
(fill tmp 0 :start (+ data-length 1))
(setf (aref tmp 135) (logior (aref tmp 135) #x80))
(dotimes-unrolled (i 17)
(setf (aref state i) (logxor (aref state i) (ub64ref/le tmp (* i 8)))))
(keccakf state)
(let ((result (make-array 200 :element-type '(unsigned-byte 8))))
(dotimes-unrolled (i 25)
(setf (ub64ref/le result (* i 8)) (aref state i)))
result)))
| 5,366 | Common Lisp | .lisp | 110 | 34.254545 | 98 | 0.509535 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 72eed2720dfbee5be0bc384cd60bc3c5cad6daf911a1e84861ba7aea2949510a | 8,058 | [
-1
] |
8,059 | signature.lisp | glv2_cl-monero-tools/monero-tools/crypto/signature.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun generate-signature (data secret-key)
"Return a Schnorr signature of DATA by SECRET-KEY."
(check-type data octet-vector)
(check-type secret-key (octet-vector #.+key-length+))
(let* ((public-key (secret-key->public-key secret-key))
(s (bytes->integer secret-key))
(k-data (random-scalar))
(k (bytes->integer k-data))
(k-point (secret-key->public-key k-data))
(c-data (hash-to-scalar (concatenate 'octet-vector data public-key k-point)))
(c (bytes->integer c-data))
(r-data (integer->bytes (mod (- k (* c s)) +l+) :size +key-length+)))
(concatenate 'octet-vector c-data r-data)))
(defun valid-signature-p (data public-key signature)
"Return T if a Schnorr SIGNATURE of DATA by the secret key matching
a PUBLIC-KEY is valid, and NIL otherwise."
(check-type data octet-vector)
(check-type public-key (octet-vector #.+key-length+))
(check-type signature (octet-vector #.(* 2 +key-length+)))
(let* ((p (bytes->point public-key))
(c (bytes->integer signature :start 0 :end +key-length+))
(r (bytes->integer signature :start +key-length+))
(k-point (point+ (point* +g+ r) (point* p c)))
(k-data (point->bytes k-point))
(h-data (hash-to-scalar (concatenate 'octet-vector data public-key k-data)))
(h (bytes->integer h-data)))
(= c h)))
(defun compute-key-image (secret-key &optional (public-key (secret-key->public-key secret-key)))
"Compute the key image of a SECRET-KEY."
(check-type public-key (octet-vector #.+key-length+))
(check-type secret-key (octet-vector #.+key-length+))
(let* ((h (hash-to-point public-key))
(p (bytes->point h))
(s (bytes->integer secret-key)))
(point->bytes (point* p s))))
(defun interleave-vectors (a b)
"Take two vectors of same length #(a1 a2 a3...) and #(b1 b2 b3...),
and return the vector #(a1 b1 a2 b2 a3 b3...)."
(check-type a vector)
(check-type b vector)
(let* ((n (length a))
(c (make-array (* 2 n))))
(unless (= (length b) n)
(error "The vectors don't have the same length."))
(dotimes (i n c)
(setf (aref c (* 2 i)) (aref a i)
(aref c (+ (* 2 i) 1)) (aref b i)))))
(defun compute-non-interactive-challenge (data a b)
"Compute the non-interactive challenge used in ring signatures."
(check-type data octet-vector)
(check-type a (vector point))
(check-type b (vector point))
(hash-to-scalar (join-bytes (cons data (map 'list
#'point->bytes
(interleave-vectors a b))))))
(defun generate-ring-signature (data public-keys secret-key secret-index)
"Return a ring signature of DATA by SECRET-KEY using a set of
PUBLIC-KEYS. The public key matching the SECRET-KEY must be at
SECRET-INDEX in the PUBLIC-KEYS vector."
(check-type data octet-vector)
(check-type public-keys (vector (octet-vector #.+key-length+)))
(check-type secret-key (octet-vector #.+key-length+))
(check-type secret-index (integer 0))
(let* ((public-key (aref public-keys secret-index))
(key-image (compute-key-image secret-key public-key))
(ki (bytes->point key-image))
(n (length public-keys))
(s (bytes->integer secret-key))
(a (make-array n))
(b (make-array n))
(c (make-array n))
(r (make-array n))
(sum 0))
(dotimes (i n)
(let ((p (bytes->point (aref public-keys i)))
(hp (bytes->point (hash-to-point (aref public-keys i))))
(q (1+ (strong-random (1- +l+))))
(w (1+ (strong-random (1- +l+)))))
(if (= i secret-index)
(setf (aref a i) (point* +g+ q)
(aref b i) (point* hp q)
(aref r i) q)
(setf (aref a i) (point+ (point* +g+ q) (point* p w))
(aref b i) (point+ (point* hp q) (point* ki w))
(aref c i) w
(aref r i) q
sum (mod (+ sum w) +l+)))))
(let ((h (bytes->integer (compute-non-interactive-challenge data a b))))
(setf (aref c secret-index) (mod (- h sum) +l+)
(aref r secret-index) (mod (- (aref r secret-index) (* (aref c secret-index) s)) +l+))
(join-bytes (map 'list
(lambda (x)
(integer->bytes x :size +key-length+))
(interleave-vectors c r))))))
(defun valid-ring-signature-p (data public-keys key-image signature)
"Return T if a ring SIGNATURE of DATA by the secret key matching
a KEY-IMAGE using a set of PUBLIC-KEYS is valid, and NIL otherwise."
(check-type data octet-vector)
(check-type public-keys (vector (octet-vector #.+key-length+)))
(check-type key-image (octet-vector #.+key-length+))
(check-type signature octet-vector)
(let* ((n (length public-keys))
(ki (bytes->point key-image))
(a (make-array n))
(b (make-array n))
(sum 0))
(unless (= (length signature) (* 2 n +key-length+))
(error "Bad ring signature length."))
(dotimes (i n)
(let* ((p (bytes->point (aref public-keys i)))
(hp (bytes->point (hash-to-point (aref public-keys i))))
(index-c (* 2 i +key-length+))
(index-r (* (+ (* 2 i) 1) +key-length+))
(c (bytes->integer signature :start index-c :end index-r))
(r (bytes->integer signature :start index-r :end (+ index-r +key-length+))))
(setf (aref a i) (point+ (point* +g+ r) (point* p c))
(aref b i) (point+ (point* hp r) (point* ki c))
sum (mod (+ sum c) +l+))))
(let ((h (bytes->integer (compute-non-interactive-challenge data a b))))
(= h sum))))
| 6,004 | Common Lisp | .lisp | 125 | 39.904 | 98 | 0.585619 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 37a27ffe2fde02d38ef1df82aa760b9c2bae387bf719d1393ea497d60788462e | 8,059 | [
-1
] |
8,060 | proof.lisp | glv2_cl-monero-tools/monero-tools/crypto/proof.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(define-constant +hash-key-transaction-proof-v2+ (string->bytes "TXPROOF_V2")
:test #'equalp)
(defun generate-transaction-proof (transaction-hash recipient-public-view-key key-derivation transaction-secret-key)
"Return a signature proving that a transaction to a recipient was
made."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type recipient-public-view-key (octet-vector #.+key-length+))
(check-type key-derivation (octet-vector #.+key-length+))
(check-type transaction-secret-key (octet-vector #.+key-length+))
(let* ((a (bytes->point recipient-public-view-key))
(s (bytes->integer transaction-secret-key))
(k (1+ (strong-random (1- +l+))))
(x (point* +g+ k))
(y (point* a k))
(c-data (hash-to-scalar (concatenate 'octet-vector
transaction-hash
key-derivation
(point->bytes x)
(point->bytes y))))
(c (bytes->integer c-data))
(r-data (integer->bytes (mod (- k (* c s)) +l+) :size +key-length+)))
(concatenate 'octet-vector c-data r-data)))
(defun verify-transaction-proof (transaction-hash recipient-public-view-key key-derivation transaction-public-key proof)
"Return T if a PROOF of transaction is valid, and NIL otherwise."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type recipient-public-view-key (octet-vector #.+key-length+))
(check-type key-derivation (octet-vector #.+key-length+))
(check-type transaction-public-key (octet-vector #.+key-length+))
(check-type proof (octet-vector #.(* 2 +key-length+)))
(let* ((c (bytes->integer proof :start 0 :end +key-length+))
(r (bytes->integer proof :start +key-length+))
(x (point+ (point* (bytes->point transaction-public-key) c)
(point* +g+ r)))
(y (point+ (point* (bytes->point key-derivation) c)
(point* (bytes->point recipient-public-view-key) r)))
(h (bytes->integer (hash-to-scalar (concatenate 'octet-vector
transaction-hash
key-derivation
(point->bytes x)
(point->bytes y))))))
(= c h)))
(defun generate-transaction-proof-v2 (transaction-hash transaction-public-key recipient-public-view-key recipient-public-spend-key key-derivation transaction-secret-key)
"Return a signature proving that a transaction to a recipient was made."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-key (octet-vector #.+key-length+))
(check-type recipient-public-view-key (octet-vector #.+key-length+))
(check-type recipient-public-spend-key (or null (octet-vector #.+key-length+)))
(check-type key-derivation (octet-vector #.+key-length+))
(check-type transaction-secret-key (octet-vector #.+key-length+))
(let* ((a (bytes->point recipient-public-view-key))
(b (if recipient-public-spend-key
(bytes->point recipient-public-spend-key)
+g+))
(s (bytes->integer transaction-secret-key))
(k (1+ (strong-random (1- +l+))))
(sep (fast-hash +hash-key-transaction-proof-v2+))
(x (point* b k))
(y (point* a k))
(recipient-public-spend-key (or recipient-public-spend-key
(make-array +key-length+
:element-type '(unsigned-byte 8)
:initial-element 0)))
(c-data (hash-to-scalar (concatenate 'octet-vector
transaction-hash
key-derivation
(point->bytes x)
(point->bytes y)
sep
transaction-public-key
recipient-public-view-key
recipient-public-spend-key)))
(c (bytes->integer c-data))
(r (mod (- k (* c s)) +l+))
(r-data (integer->bytes r :size +key-length+)))
(concatenate 'octet-vector c-data r-data)))
(defun check-transaction-proof-v2 (transaction-hash transaction-public-key recipient-public-view-key recipient-public-spend-key key-derivation proof)
"Return T if a PROOF of transaction is valid, and NIL otherwise."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-key (octet-vector #.+key-length+))
(check-type recipient-public-view-key (octet-vector #.+key-length+))
(check-type recipient-public-spend-key (or null (octet-vector #.+key-length+)))
(check-type key-derivation (octet-vector #.+key-length+))
(check-type proof (octet-vector #.(* 2 +key-length+)))
(let* ((p (bytes->point transaction-public-key))
(a (bytes->point recipient-public-view-key))
(b (if recipient-public-spend-key
(bytes->point recipient-public-spend-key)
+g+))
(d (bytes->point key-derivation))
(c (bytes->integer proof :start 0 :end +key-length+))
(r (bytes->integer proof :start +key-length+))
(sep (fast-hash +hash-key-transaction-proof-v2+))
(x (point+ (point* p c) (point* b r)))
(y (point+ (point* d c) (point* a r)))
(recipient-public-spend-key (or recipient-public-spend-key
(make-array +key-length+
:element-type '(unsigned-byte 8)
:initial-element 0)))
(h-data (hash-to-scalar (concatenate 'octet-vector
transaction-hash
key-derivation
(point->bytes x)
(point->bytes y)
sep
transaction-public-key
recipient-public-view-key
recipient-public-spend-key)))
(h (bytes->integer h-data)))
(= c h)))
(defun generate-inbound-transaction-proof-v1 (transaction-hash transaction-public-key secret-view-key public-spend-key message)
"Return a shared secret and a signature proving the existence of an
inbound transaction (with specified TRANSACTION-HASH and
TRANSACTION-PUBLIC-KEY) for a recipient (with specified
SECRET-VIEW-KEY and PUBLIC-SPEND-KEY). An arbitrary MESSAGE can be
signed along with the TRANSACTION-HASH."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-key (octet-vector #.+key-length+))
(check-type secret-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(let* ((data (concatenate 'octet-vector transaction-hash message))
(p (bytes->point transaction-public-key))
(a (bytes->integer secret-view-key))
(b (bytes->point public-spend-key))
(e (point* p a))
(e-data (point->bytes e))
(k (1+ (strong-random (1- +l+))))
(l1 (point* b k))
(l2 (point* p k))
(c-data (hash-to-scalar (concatenate 'octet-vector
(fast-hash data)
e-data
(point->bytes l1)
(point->bytes l2))))
(c (bytes->integer c-data))
(r (mod (- k (* c a)) +l+))
(r-data (integer->bytes r :size +key-length+)))
(values e-data (concatenate 'octet-vector c-data r-data))))
(defun verify-inbound-transaction-proof-v1 (transaction-hash transaction-public-key public-view-key public-spend-key message shared-secret proof &optional transaction-secret-key)
"Return T if a PROOF of inbound transaction is valid, and NIL
otherwise."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-key (octet-vector #.+key-length+))
(check-type public-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(check-type shared-secret (octet-vector #.+key-length+))
(check-type proof (octet-vector #.(* 2 +key-length+)))
(let* ((data (concatenate 'octet-vector transaction-hash message))
(p (bytes->point transaction-public-key))
(a (bytes->point public-view-key))
(b (bytes->point public-spend-key))
(e (bytes->point shared-secret))
(c (bytes->integer proof :start 0 :end +key-length+))
(r (bytes->integer proof :start +key-length+))
(l1 (point+ (point* a c) (point* b r)))
(l2 (point+ (point* e c) (point* p r)))
(h (bytes->integer (hash-to-scalar (concatenate 'octet-vector
(fast-hash data)
shared-secret
(point->bytes l1)
(point->bytes l2))))))
(if (null transaction-secret-key)
(= c h)
(let* ((s (bytes->point transaction-secret-key))
(f (point* a s)))
(and (point= e f) (= c h))))))
(defun generate-inbound-transaction-proof-v2 (transaction-hash transaction-public-keys secret-view-key public-view-key public-spend-key subaddress-p message)
"Return shared secrets and a signatures proving the existence of an inbound
transaction (with specified TRANSACTION-HASH and TRANSACTION-PUBLIC-KEY) for
a recipient (with specified SECRET-VIEW-KEY, PUBLIC-VIEW-KEY and
PUBLIC-SPEND-KEY). An arbitrary MESSAGE can be signed along with the
TRANSACTION-HASH."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-keys list)
(check-type secret-view-key (octet-vector #.+key-length+))
(check-type public-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(let* ((data (fast-hash (concatenate 'octet-vector transaction-hash message)))
(a (bytes->integer secret-view-key)))
(flet ((compute-proof (public-key)
(let* ((p (bytes->point public-key))
(shared-secret (point->bytes (point* p a)))
(proof (generate-transaction-proof-v2 data
public-view-key
public-key
(if subaddress-p
public-spend-key
nil)
shared-secret
secret-view-key)))
(list shared-secret proof))))
(join-bytes (mapcan #'compute-proof transaction-public-keys)))))
(defun verify-inbound-transaction-proof-v2 (transaction-hash transaction-public-keys secret-view-key public-view-key public-spend-key subaddress-p message proof)
"Return T if a PROOF of inbound transaction is valid, and NIL otherwise."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-keys list)
(check-type secret-view-key (octet-vector #.+key-length+))
(check-type public-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(check-type proof octet-vector)
(let* ((data (fast-hash (concatenate 'octet-vector transaction-hash message)))
(shared-secrets (iter (for i from 0 below (length proof) by (* 3 +key-length+))
(collect (subseq proof i (+ i +key-length+)))))
(proofs (iter (for i from +key-length+ below (length proof) by (* 3 +key-length+))
(collect (subseq proof i (+ i (* 2 +key-length+)))))))
(flet ((check-proof (public-key shared-secret proof)
(check-transaction-proof-v2 data
public-view-key
public-key
(if subaddress-p
public-spend-key
nil)
shared-secret
proof)))
(some #'check-proof transaction-public-keys shared-secrets proofs))))
(defun generate-outbound-transaction-proof-v1 (transaction-hash transaction-secret-key public-view-key public-spend-key message)
"Return a shared secret and a signature proving the existence of an
outbound transaction (with specified TRANSACTION-HASH and
TRANSACTION-SECRET-KEY) for a recipient (with specified
PUBLIC-VIEW-KEY and PUBLIC-SPEND-KEY). An arbitrary MESSAGE can be
signed along with the TRANSACTION-HASH."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-secret-key (octet-vector #.+key-length+))
(check-type public-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(let* ((data (concatenate 'octet-vector transaction-hash message))
(s (bytes->integer transaction-secret-key))
(a (bytes->point public-view-key))
(b (bytes->point public-spend-key))
(e (point* a s))
(e-data (point->bytes e)) ; TODO: check validity of shared secret using secret-view-key
(k (1+ (strong-random (1- +l+))))
(l1 (point* b k))
(l2 (point* a k))
(c-data (hash-to-scalar (concatenate 'octet-vector
(fast-hash data)
e-data
(point->bytes l1)
(point->bytes l2))))
(c (bytes->integer c-data))
(r (mod (- k (* c s)) +l+))
(r-data (integer->bytes r :size +key-length+)))
(values e-data (concatenate 'octet-vector c-data r-data))))
(defun verify-outbound-transaction-proof-v1 (transaction-hash transaction-public-key public-view-key public-spend-key message shared-secret proof &optional secret-view-key)
"Return T if a PROOF of outbound transaction is valid, and NIL
otherwise."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-key (octet-vector #.+key-length+))
(check-type public-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(check-type shared-secret (octet-vector #.+key-length+))
(check-type proof (octet-vector #.(* 2 +key-length+)))
(let* ((data (concatenate 'octet-vector transaction-hash message))
(p (bytes->point transaction-public-key))
(a (bytes->point public-view-key))
(b (bytes->point public-spend-key))
(e (bytes->point shared-secret)) ; TODO: check validity of shared secret
(c (bytes->integer proof :start 0 :end +key-length+))
(r (bytes->integer proof :start +key-length+))
(l1 (point+ (point* p c) (point* b r)))
(l2 (point+ (point* e c) (point* a r)))
(h (bytes->integer (hash-to-scalar (concatenate 'octet-vector
(fast-hash data)
shared-secret
(point->bytes l1)
(point->bytes l2))))))
(if (null secret-view-key)
(= c h)
(let* ((s (bytes->integer secret-view-key))
(f (point* p s)))
(and (point= e f) (= c h))))))
(defun generate-outbound-transaction-proof-v2 (transaction-hash transaction-secret-keys public-view-key public-spend-key subaddress-p message)
"Return shared secrets and signatures proving the existence of an outbound
transaction (with specified TRANSACTION-HASH and TRANSACTION-SECRET-KEYS) for
a recipient (with specified PUBLIC-VIEW-KEY, PUBLIC-SPEND-KEY and
SUBADDRESS-P). An arbitrary MESSAGE can be signed along with the
TRANSACTION-HASH."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-secret-keys list)
(check-type public-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(let* ((data (fast-hash (concatenate 'octet-vector transaction-hash message)))
(a (bytes->point public-view-key))
(b (bytes->point public-spend-key)))
(flet ((compute-proof (secret-key)
(let* ((s (bytes->integer secret-key))
(shared-secret (point->bytes (point* a s)))
(p (if subaddress-p b +g+))
(public-key (point->bytes (point* p s)))
(proof (generate-transaction-proof-v2 data
public-key
public-view-key
(if subaddress-p
public-spend-key
nil)
shared-secret
secret-key)))
(list shared-secret proof))))
(join-bytes (mapcan #'compute-proof transaction-secret-keys)))))
(defun verify-outbound-transaction-proof-v2 (transaction-hash transaction-public-keys secret-view-key public-view-key public-spend-key subaddress-p message proof)
"Return T if a PROOF of outbound transaction is valid, and NIL otherwise."
(check-type transaction-hash (octet-vector #.+hash-length+))
(check-type transaction-public-keys list)
(check-type secret-view-key (octet-vector #.+key-length+))
(check-type public-view-key (octet-vector #.+key-length+))
(check-type public-spend-key (octet-vector #.+key-length+))
(check-type message octet-vector)
(check-type proof octet-vector)
(let* ((data (fast-hash (concatenate 'octet-vector transaction-hash message)))
(shared-secrets (iter
(for i from 0 below (length proof) by (* 3 +key-length+))
(collect (subseq proof i (+ i +key-length+)))))
(proofs (iter
(for i from +key-length+ below (length proof) by (* 3 +key-length+))
(collect (subseq proof i (+ i (* 2 +key-length+)))))))
(flet ((check-proof (public-key shared-secret proof)
(check-transaction-proof-v2 data
public-key
public-view-key
(if subaddress-p
public-spend-key
nil)
shared-secret
proof)))
(some #'check-proof transaction-public-keys shared-secrets proofs))))
| 20,322 | Common Lisp | .lisp | 336 | 43.904762 | 178 | 0.551828 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 3353a9043546f4e7c24dca46b415a21604e1facc7bf175767e15de8359a85cbb | 8,060 | [
-1
] |
8,061 | crypto.lisp | glv2_cl-monero-tools/monero-tools/crypto/crypto.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
;;; Public key cryptography functions
(eval-when (:compile-toplevel :load-toplevel :execute)
(defconstant +key-length+ 32))
(define-constant +one+ +ed25519-point-at-infinity+ :test #'equalp)
(define-constant +g+ +ed25519-b+ :test #'equalp)
(let ((h (hex-string->bytes "8b655970153799af2aeadc9ff1add0ea6c7251d54154cfa92c173a0dd39c1f94")))
(define-constant +h+ (ec-decode-point :ed25519 h) :test #'equalp))
(defconstant +q+ +ed25519-q+)
(defconstant +l+ +ed25519-l+)
(defconstant +i+ +ed25519-i+)
(defconstant +a+ 486662)
(defconstant +fffb1+ 57192811444617977854858898469001663971726463542204390960804972474891788632558)
(defconstant +fffb2+ 34838897745748397871374137087405348832069628406613012804793447631241588021984)
(defconstant +fffb3+ 46719087769223307720043111813545796356806574765024592941723029582131464514662)
(defconstant +fffb4+ 11880190023474909848668974726140447524736946358411580136929581950889876492678)
(deftype point ()
'ed25519-point)
(defun make-point (x y z w)
"Make a point on Ed25519."
(check-type x integer)
(check-type y integer)
(check-type z integer)
(check-type w integer)
(make-instance 'ed25519-point :x x :y y :z z :w w))
(defun point->bytes (point)
"Convert an Ed25519 POINT to a sequence of bytes."
(check-type point point)
(ec-encode-point point))
(defun bytes->point (bytes)
"Convert a sequence of BYTES to an Ed25519 point."
(check-type bytes (octet-vector #.+key-length+))
(ec-decode-point :ed25519 bytes))
(defun point+ (p1 p2)
"Point addition on Ed25519."
(check-type p1 point)
(check-type p2 point)
(ec-add p1 p2))
(defun point- (p1 p2)
"Point subtraction on Ed25519."
(check-type p1 point)
(check-type p2 point)
(with-slots ((x crypto::x) (y crypto::y) (z crypto::z) (w crypto::w)) p2
(let ((inv-p2 (make-point (- +q+ x) y z (- +q+ w))))
(point+ p1 inv-p2))))
(defun point* (point n)
"Scalar multiplication on Ed25519."
(check-type point point)
(check-type n (integer 0))
(ec-scalar-mult point n))
(defun point= (p1 p2)
"Point equality on Ed25519."
(check-type p1 point)
(check-type p2 point)
(ec-point-equal p1 p2))
(defun point*8 (point)
"Multiply a POINT by 8."
(check-type point point)
(let* ((p2 (point+ point point))
(p4 (point+ p2 p2)))
(point+ p4 p4)))
(defun reduce-scalar (data)
"Return the byte vector representing DATA modulo +L+."
(check-type data octet-vector)
(integer->bytes (mod (bytes->integer data) +l+) :size +key-length+))
(defun random-scalar ()
"Return a random number modulo +L+."
(integer->bytes (strong-random +l+) :size +key-length+))
;;; Hash functions
(defconstant +hash-length+ 32)
(defun fast-hash (data)
"Fast hash function (Keccak1600) for the Cryptonote protocol."
(check-type data octet-vector)
(subseq (keccak1600 data) 0 +hash-length+))
(defparameter *slow-hash-variant* :cryptonight)
(defparameter *slow-hash-height* nil)
(defparameter *slow-hash-seed* nil)
(defun slow-hash (data &optional (variant *slow-hash-variant*) (height *slow-hash-height*) (seed *slow-hash-seed*))
"Slow hash function for the Cryptonote protocol. The supported variants
are :cryptonight, :cryptonight-variant-1, :cryptonight-variant-2,
:cryptonight-r and :randomx.
The :cryptonight-r variant requires a block HEIGHT.
The :randomx variant requires a SEED, which is the ID of the block at
height (randomx-seed-height current-block-height)."
(check-type data octet-vector)
(check-type height (or null fixnum))
(check-type seed (or null octet-vector))
(case variant
(:cryptonight (cryptonight data 0 0))
(:cryptonight-variant-1 (cryptonight data 1 0))
(:cryptonight-variant-2 (cryptonight data 2 0))
(:cryptonight-r (if height
(cryptonight data 4 height)
(error "Cryptonight-R requires a block height.")))
(:randomx (if seed
(randomx data seed)
(error "RandomX requires a seed.")))
(t (error "Variant not supported."))))
(defun tree-hash (data count)
"Tree hash function for the transactions Merkle tree."
(check-type data octet-vector)
(check-type count (integer 1))
(flet ((tree-hash-count (count)
(ash 1 (1- (integer-length (1- count)))))
(fast-hash (data start end)
(digest-sequence :keccak/256 data :start start :end end)))
(cond
((= count 1)
(subseq data 0 +hash-length+))
((= count 2)
(fast-hash data 0 (* 2 +hash-length+)))
(t
(let* ((cnt (tree-hash-count count))
(tmp (make-array (* cnt +hash-length+)
:element-type '(unsigned-byte 8)
:initial-element 0)))
(replace tmp data :end2 (* (- (* 2 cnt) count) +hash-length+))
(iter
(for i from (- (* 2 cnt) count) by 2)
(for j from (- (* 2 cnt) count))
(while (< j cnt))
(replace tmp (fast-hash data (* i +hash-length+) (* (+ i 2) +hash-length+))
:start1 (* j +hash-length+) :end1 (* (1+ j) +hash-length+)))
(iter
(while (> cnt 2))
(setf cnt (ash cnt -1))
(iter
(for i from 0 by 2)
(for j from 0)
(while (< j cnt))
(replace tmp (fast-hash tmp (* i +hash-length+) (* (+ i 2) +hash-length+))
:start1 (* j +hash-length+) :end1 (* (1+ j) +hash-length+))))
(fast-hash tmp 0 (* 2 +hash-length+)))))))
(defun hash-to-scalar (data)
"Make a scalar usable with the ED25519 curve from DATA and return it
as a byte vector."
(check-type data octet-vector)
(reduce-scalar (fast-hash data)))
(defun hash-to-point (data)
"Make a point on the ED25519 curve from DATA and return it
as a byte vector."
(check-type data octet-vector)
(let* ((u (mod (bytes->integer (fast-hash data)) +q+))
(v (mod (* 2 u u) +q+))
(w (mod (+ v 1) +q+))
(x (mod (* w w) +q+))
(y (mod (* -1 +a+ +a+ v) +q+))
(x (mod (+ x y) +q+))
(x3 (mod (* x x x) +q+))
(wx3 (mod (* w x3) +q+))
(wx7 (mod (* wx3 x3 x) +q+))
(res-x (mod (* wx3 (expt-mod wx7 (/ (- +q+ 5) 8) +q+)) +q+))
(y (mod (* res-x res-x) +q+))
(x (mod (* y x) +q+))
(y (mod (- w x) +q+))
(z (mod (- +a+) +q+)))
(flet ((make-point-and-return (sign x w z)
(unless (= (logand x 1) sign)
(setf x (mod (- x) +q+)))
(let* ((pz (mod (+ z w) +q+))
(py (mod (- z w) +q+))
(px (mod (* x pz) +q+))
(inv-pz (ec-scalar-inv :ed25519 pz))
(pw (mod (* px py inv-pz) +q+))
(point (make-point px py pz pw)))
(return-from hash-to-point (point->bytes (point*8 point))))))
(if (zerop y)
(setf res-x (mod (* res-x +fffb2+) +q+))
(progn
(setf y (mod (+ w x) +q+))
(if (zerop y)
(setf res-x (mod (* res-x +fffb1+) +q+))
(progn
(setf x (mod (* x +i+) +q+))
(setf y (mod (- w x) +q+))
(if (zerop y)
(setf res-x (mod (* res-x +fffb4+) +q+))
(setf res-x (mod (* res-x +fffb3+) +q+)))
(make-point-and-return 1 res-x w z)))))
(setf res-x (mod (* res-x u) +q+))
(setf z (mod (* z v) +q+))
(make-point-and-return 0 res-x w z))))
;;; Data encryption/decryption functions
(eval-when (:compile-toplevel :load-toplevel :execute)
(defconstant +chacha-key-length+ 32)
(defconstant +chacha-iv-length+ 8))
(defconstant +chacha-key-tail+ 140)
(defconstant +cache-key-tail+ 141)
(defun chacha8 (data key iv)
"Encrypt/decrypt DATA with the KEY and the initialization vector IV."
(check-type data octet-vector)
(check-type key (octet-vector #.+chacha-key-length+))
(check-type iv (octet-vector #.+chacha-iv-length+))
(let ((cipher (make-cipher :chacha/8 :key key
:mode :stream
:initialization-vector iv))
(ciphertext (make-array (length data) :element-type '(unsigned-byte 8))))
(encrypt cipher data ciphertext)
ciphertext))
(defun chacha20 (data key iv)
"Encrypt/decrypt DATA with the KEY and the initialization vector IV."
(check-type data octet-vector)
(check-type key (octet-vector #.+chacha-key-length+))
(check-type iv (octet-vector #.+chacha-iv-length+))
(let ((cipher (make-cipher :chacha :key key
:mode :stream
:initialization-vector iv))
(ciphertext (make-array (length data) :element-type '(unsigned-byte 8))))
(encrypt cipher data ciphertext)
ciphertext))
(defun generate-chacha-key (password &optional (rounds 1))
"Generate the encryption/decryption key matching a PASSWORD."
(check-type password string)
(check-type rounds (integer 1 *))
(do ((i (1- rounds) (1- i))
(hash (slow-hash (utf-8-string->bytes password)) (slow-hash hash)))
((zerop i) (subseq hash 0 +chacha-key-length+))))
(defun generate-chacha-key-from-secret-keys (secret-view-key secret-spend-key)
"Generate the encryption/decryption key matching a wallet's secret
keys."
(check-type secret-view-key (octet-vector #.+key-length+))
(check-type secret-spend-key (octet-vector #.+key-length+))
(let ((data (concatenate 'octet-vector
secret-view-key
secret-spend-key
(vector +chacha-key-tail+))))
(subseq (slow-hash data) 0 +chacha-key-length+)))
(defun generate-cache-chacha-key (password &optional (rounds 1))
"Generate the wallet cache encryption/decryption key matching a PASSWORD."
(check-type password string)
(check-type rounds (integer 1 *))
(let ((data (concatenate 'octet-vector
(generate-chacha-key password rounds)
(vector +cache-key-tail+))))
(subseq (fast-hash data) 0 +chacha-key-length+)))
| 10,398 | Common Lisp | .lisp | 239 | 36.150628 | 115 | 0.606144 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 9943dccf52272bec4e2c2cb2ba208dc3b7fd73a3b6366c18e9fa59ca48967ff0 | 8,061 | [
-1
] |
8,062 | multisig.lisp | glv2_cl-monero-tools/monero-tools/crypto/multisig.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(define-constant +multisig-salt+ (map 'octet-vector #'char-code '(#\M #\u #\l #\t #\i #\s #\i #\g
#\nul #\nul #\nul #\nul #\nul
#\nul #\nul #\nul #\nul #\nul
#\nul #\nul #\nul #\nul #\nul
#\nul #\nul #\nul #\nul #\nul
#\nul #\nul #\nul #\nul))
:test #'equalp)
(defun compute-multisig-blinded-secret (secret-key)
(check-type secret-key (octet-vector #.+key-length+))
(hash-to-scalar (concatenate 'octet-vector secret-key +multisig-salt+)))
(defun compute-multisig-secret-view-key (secret-view-keys)
"Compute the secret view key of a multi-signature wallet from the
SECRET-VIEW-KEYS of the owners of the wallet."
(check-type secret-view-keys (vector (octet-vector #.+key-length+)))
(integer->bytes (reduce (lambda (x y)
(mod (+ x y) +l+))
(map 'vector #'bytes->integer secret-view-keys))
:size +key-length+))
(defun compute-multisig-keys-n/n (secret-spend-key)
"Compute the key of a n/n multi-signature wallet from your SECRET-SPEND-KEY."
(check-type secret-spend-key (octet-vector #.+key-length+))
(vector (compute-multisig-blinded-secret secret-spend-key)))
(defun compute-multisig-keys-m/n (public-spend-keys secret-spend-key)
"Compute the composite keys of a m/n multi-signature wallet from your
SECRET-SPEND-KEY and the PUBLIC-SPEND-KEYS of the other owners of the wallet."
(check-type public-spend-keys (vector (octet-vector #.+key-length+)))
(check-type secret-spend-key (octet-vector #.+key-length+))
(let ((s (bytes->integer (compute-multisig-blinded-secret secret-spend-key))))
(map 'vector
(lambda (x)
(let ((p (bytes->point x)))
(compute-multisig-blinded-secret (point->bytes (point* p s)))))
public-spend-keys)))
(defun compute-multisig-secret-spend-key (multisig-keys)
(check-type multisig-keys (vector (octet-vector #.+key-length+)))
(integer->bytes (reduce (lambda (x y)
(mod (+ x y) +l+))
(map 'vector #'bytes->integer multisig-keys)
:initial-value 0)
:size +key-length+))
(defun compute-multisig-public-keys (multisig-keys)
"Compute the public keys of a multi-signature wallet from the MULTISIG-KEYS."
(check-type multisig-keys (vector (octet-vector #.+key-length+)))
(map 'vector
(lambda (x)
(let ((y (bytes->integer x)))
(point->bytes (point* +g+ y))))
multisig-keys))
(defun compute-multisig-public-spend-key (multisig-public-keys)
"Compute the public spend key of a multi-signature wallet from the
MULTISIG-PUBLIC-KEYS generated by the owners of the wallet."
(check-type multisig-public-keys (vector (octet-vector #.+key-length+)))
(let ((unique-keys (remove-duplicates multisig-public-keys :test (complement #'mismatch))))
(point->bytes (reduce #'point+ (map 'vector #'bytes->point unique-keys)))))
| 3,474 | Common Lisp | .lisp | 59 | 47.084746 | 97 | 0.595182 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 0fa1786e09b0d2bdb16cdb8e93948385ab30579d5ec392e1aa2752ce7f4598b7 | 8,062 | [
-1
] |
8,063 | address.lisp | glv2_cl-monero-tools/monero-tools/wallet/address.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defconstant +address-base58-prefix+ 18)
(defconstant +integrated-address-base58-prefix+ 19)
(defconstant +subaddress-base58-prefix+ 42)
(defconstant +stagenet-address-base58-prefix+ 24)
(defconstant +stagenet-integrated-address-base58-prefix+ 25)
(defconstant +stagenet-subaddress-base58-prefix+ 36)
(defconstant +testnet-address-base58-prefix+ 53)
(defconstant +testnet-integrated-address-base58-prefix+ 54)
(defconstant +testnet-subaddress-base58-prefix+ 63)
(defun encode-address (public-spend-key public-view-key &key payment-id subaddress (chain :mainnet))
"Return the base58 encoded Monero address matching the
PUBLIC-SPEND-KEY and PUBLIC-VIEW-KEY. If a PAYMENT-ID is supplied, an
integrated address is returned. If SUBADDRESS is T, a subaddress is
returned. CHAIN can be :MAINNET, :STAGENET or :TESTNET."
(when (and payment-id subaddress)
(error "Integrated subaddress not supported."))
(macrolet ((concat (&rest sequences)
`(concatenate 'octet-vector ,@sequences)))
(let* ((tag (vector (case chain
((:mainnet nil t)
(cond (subaddress +subaddress-base58-prefix+)
(payment-id +integrated-address-base58-prefix+)
(t +address-base58-prefix+)))
((:stagenet)
(cond (subaddress +stagenet-subaddress-base58-prefix+)
(payment-id +stagenet-integrated-address-base58-prefix+)
(t +stagenet-address-base58-prefix+)))
((:testnet)
(cond (subaddress +testnet-subaddress-base58-prefix+)
(payment-id +testnet-integrated-address-base58-prefix+)
(t +testnet-address-base58-prefix+)))
(t
(error "Address for an unknown chain.")))))
(data (concat tag public-spend-key public-view-key payment-id))
(hash (subseq (fast-hash data) 0 +base58-checksum-size+)))
(base58-encode (concat data hash)))))
(defun decode-address (address)
"Return an alist containing the components of a Monero ADDRESS."
(let* ((data (base58-decode address))
(size (length data))
(tag (aref data 0))
(chain (cond
((or (= tag +address-base58-prefix+)
(= tag +integrated-address-base58-prefix+)
(= tag +subaddress-base58-prefix+))
:mainnet)
((or (= tag +stagenet-address-base58-prefix+)
(= tag +stagenet-integrated-address-base58-prefix+)
(= tag +stagenet-subaddress-base58-prefix+))
:stagenet)
((or (= tag +testnet-address-base58-prefix+)
(= tag +testnet-integrated-address-base58-prefix+)
(= tag +testnet-subaddress-base58-prefix+))
:testnet)
(t
(error "Address for an unknown chain."))))
(integrated-address (or (= tag +integrated-address-base58-prefix+)
(= tag +stagenet-integrated-address-base58-prefix+)
(= tag +testnet-integrated-address-base58-prefix+)))
(subaddress (or (= tag +subaddress-base58-prefix+)
(= tag +stagenet-subaddress-base58-prefix+)
(= tag +testnet-subaddress-base58-prefix+)))
(public-spend-key (subseq data 1 33))
(public-view-key (subseq data 33 65))
(payment-id (when integrated-address
(subseq data 65 (- size +base58-checksum-size+))))
(hash (subseq data (- size +base58-checksum-size+) size)))
(let* ((data (subseq data 0 (- size +base58-checksum-size+)))
(computed-hash (subseq (fast-hash data) 0 +base58-checksum-size+)))
(unless (equalp hash computed-hash)
(error "Bad checksum.")))
(append (list (cons :public-spend-key public-spend-key)
(cons :public-view-key public-view-key)
(cons :chain chain))
(when integrated-address
(list (cons :payment-id payment-id)))
(when subaddress
(list (cons :subaddress subaddress))))))
(defun valid-address-p (address)
"Check if a Monero ADDRESS is valid. The first returned value is T if ADDRESS
is a valid Monero address, and NIL otherwise. If the ADDRESS is invalid, the
second returned value is a string indicating what is wrong with it."
(handler-case
(let* ((address-info (decode-address address))
(public-spend-key (geta address-info :public-spend-key))
(public-view-key (geta address-info :public-view-key))
(a (bytes->point public-view-key))
(b (bytes->point public-spend-key)))
(unless (and (point= (point* a +l+) +one+)
(point= (point* b +l+) +one+))
(error "Point not in the group of the base point."))
(values t nil))
(t (e)
(values nil (format nil "~a" e)))))
(defun public-keys->address (public-spend-key public-view-key &key subaddress (chain :mainnet))
"Get the Monero address matching the PUBLIC-SPEND-KEY and
PUBLIC-VIEW-KEY. If SUBADDRESS is T, a subaddress is returned. CHAIN
can be :MAINNET, :STAGENET or :TESTNET."
(encode-address public-spend-key public-view-key :subaddress subaddress :chain chain))
(defun public-keys->subaddress (public-spend-key secret-view-key major-index minor-index &key (chain :mainnet))
"Get the Monero subaddress matching the PUBLIC-SPEND-KEY,
SECRET-VIEW-KEY, MAJOR-INDEX and MINOR-INDEX. CHAIN can
be :MAINNET, :STAGENET or :TESTNET."
(let* ((public-spend-subkey (derive-public-spend-subkey secret-view-key
public-spend-key
major-index
minor-index))
(public-view-subkey (public-spend-subkey->public-view-subkey secret-view-key
public-spend-subkey)))
(public-keys->address public-spend-subkey public-view-subkey :subaddress t :chain chain)))
(defun secret-spend-key->address (secret-spend-key &key (chain :mainnet))
"Get the Monero address matching the SECRET-SPEND-KEY. CHAIN can
be :MAINNET, :STAGENET or :TESTNET."
(let* ((keys (recover-keys secret-spend-key))
(public-spend-key (geta keys :public-spend-key))
(public-view-key (geta keys :public-view-key)))
(public-keys->address public-spend-key public-view-key :chain chain)))
(defun secret-spend-key->subaddress (secret-spend-key major-index minor-index &key (chain :mainnet))
"Get the Monero subaddress matching the SECRET-SPEND-KEY,
MAJOR-INDEX and MINOR-INDEX. CHAIN can be :MAINNET, :STAGENET
or :TESTNET."
(let* ((keys (recover-keys secret-spend-key))
(public-spend-key (geta keys :public-spend-key))
(secret-view-key (geta keys :secret-view-key)))
(public-keys->subaddress public-spend-key
secret-view-key
major-index
minor-index
:chain chain)))
(defun make-integrated-address (address payment-id)
"Return an integrated address made from a Monero ADDRESS and a PAYMENT-ID."
(let* ((address-info (decode-address address))
(public-spend-key (geta address-info :public-spend-key))
(public-view-key (geta address-info :public-view-key))
(chain (geta address-info :chain)))
(when (geta address-info :subaddress)
(error "Integrated subaddress not supported."))
(when (geta address-info :payment-id)
(warn "~a is already an integrated address." address))
(unless (= (length payment-id) 8)
(error "Bad payment-id length."))
(encode-address public-spend-key public-view-key :payment-id payment-id :chain chain)))
| 8,392 | Common Lisp | .lisp | 147 | 44.340136 | 111 | 0.604154 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 8655c33577a0b43d687b9c0dca9229a2ff2fee836987d12d8bfab15eb6d3373d | 8,063 | [
-1
] |
8,064 | qr.lisp | glv2_cl-monero-tools/monero-tools/wallet/qr.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun make-qr-code (png-file address &key payment-id recipient-name amount description)
"Write the QR code containing the information for a payment to
a PNG-FILE."
(let ((uri (make-uri address
:payment-id payment-id
:recipient-name recipient-name
:amount amount
:description description)))
(cl-qrencode:encode-png uri :fpath png-file :mode :byte :pixsize 4)))
(define-foreign-library zbar
(t (:default "libzbar")))
(handler-case
(use-foreign-library zbar)
(load-foreign-library-error ()
(warn "The zbar library was not found.")))
(defun decode-png (file)
(if (foreign-library-loaded-p 'zbar)
(flet ((flatten-array (array)
(make-array (array-total-size array)
:displaced-to array
:element-type (array-element-type array)))
(convert-to-rgb3 (data bit-depth)
(let* ((data-length (length data))
(shift (- 8 bit-depth))
(rgb-data (make-array (* 3 data-length)
:element-type '(unsigned-byte 8))))
(iter (for i from 0 below data-length)
(let ((v (ash (aref data i) shift)))
(setf (aref rgb-data (* 3 i)) v
(aref rgb-data (+ (* 3 i) 1)) v
(aref rgb-data (+ (* 3 i) 2)) v))
(finally (return rgb-data)))))
(fourcc (fourcc)
(logior (char-code (char fourcc 0))
(ash (char-code (char fourcc 1)) 8)
(ash (char-code (char fourcc 2)) 16)
(ash (char-code (char fourcc 3)) 24))))
(let* ((png (png-read:read-png-file file))
(width (png-read:width png))
(height (png-read:height png))
(image-data (png-read:image-data png))
(data (if (= 3 (length (array-dimensions image-data)))
(flatten-array image-data)
(convert-to-rgb3 (flatten-array image-data)
(png-read:bit-depth png))))
(data-length (length data))
(processor (foreign-funcall "zbar_processor_create" :pointer))
(image (foreign-funcall "zbar_image_create" :pointer))
result)
(foreign-funcall "zbar_processor_init"
:pointer processor
:pointer (null-pointer)
:int 0
:int)
(foreign-funcall "zbar_image_set_format"
:pointer image
:unsigned-long (fourcc "RGB3"))
(foreign-funcall "zbar_image_set_size"
:pointer image
:unsigned-int width
:unsigned-int height)
(let ((tmp image))
(with-foreign-object (raw-data :unsigned-char data-length)
(lisp-array->c-array data raw-data)
(foreign-funcall "zbar_image_set_data"
:pointer image
:pointer raw-data
:unsigned-int data-length
:pointer (null-pointer))
(setf image (foreign-funcall "zbar_image_convert"
:pointer image
:unsigned-long (fourcc "Y800")
:pointer)))
(foreign-funcall "zbar_image_destroy"
:pointer tmp))
(foreign-funcall "zbar_process_image"
:pointer processor
:pointer image
:int)
(do ((symbol (foreign-funcall "zbar_image_first_symbol"
:pointer image
:pointer)
(foreign-funcall "zbar_symbol_next"
:pointer symbol
:pointer)))
((null-pointer-p symbol))
(let* ((data-length (foreign-funcall "zbar_symbol_get_data_length"
:pointer symbol
:unsigned-int))
(raw-data (foreign-funcall "zbar_symbol_get_data"
:pointer symbol
:pointer))
(data (c-array->lisp-array raw-data data-length)))
(setf result (concatenate 'vector result data))))
(foreign-funcall "zbar_image_destroy"
:pointer image)
(foreign-funcall "zbar_processor_destroy"
:pointer processor)
(bytes->string result)))
(error "QR code decoding not supported because the zbar library was not found.")))
(defun decode-qr-code (png-file)
"Return an alist containing the payment information of the QR code
in a PNG-FILE."
(let ((uri (decode-png png-file)))
(decode-uri uri)))
| 5,593 | Common Lisp | .lisp | 110 | 31.109091 | 88 | 0.468676 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 653872769bf179b4b148eeb0c86b16ab673b638e92150765cc63432aceee323a | 8,064 | [
-1
] |
8,065 | transaction.lisp | glv2_cl-monero-tools/monero-tools/wallet/transaction.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defconstant +encrypted-payment-id-tail+ 141)
(define-constant +payment-proof-header+ "ProofV1" :test #'string=)
(define-constant +inbound-transaction-proof-v1-header+ "InProofV1" :test #'string=)
(define-constant +outbound-transaction-proof-v1-header+ "OutProofV1" :test #'string=)
(define-constant +inbound-transaction-proof-v2-header+ "InProofV2" :test #'string=)
(define-constant +outbound-transaction-proof-v2-header+ "OutProofV2" :test #'string=)
(defun encrypt-payment-id (payment-id public-view-key transaction-secret-key)
"Encrypt a PAYMENT-ID using a shared secret derived from
a PUBLIC-VIEW-KEY and a TRANSACTION-SECRET-KEY."
(let* ((derivation (derive-key public-view-key transaction-secret-key))
(data (concatenate 'octet-vector derivation (vector +encrypted-payment-id-tail+)))
(key (fast-hash data)))
(map 'octet-vector #'logxor payment-id key)))
(defun decrypt-payment-id (encrypted-payment-id transaction-public-key secret-view-key)
"Decrypt an ENCRYPTED-PAYMENT-ID using a shared secret derived-from
a TRANSACTION-PUBLIC-KEY and a SECRET-VIEW-KEY."
(encrypt-payment-id encrypted-payment-id transaction-public-key secret-view-key))
(defun output-for-address-p (output-key output-index transaction-public-key additional-public-keys address secret-view-key)
"Check if an ADDRESS is the destination of an output."
(let* ((address-info (decode-address address))
(use-additional-key (and (> (length additional-public-keys) output-index)
(geta address-info :subaddress)))
(public-spend-key (geta address-info :public-spend-key))
(derivation (derive-key (if use-additional-key
(elt additional-public-keys output-index)
transaction-public-key)
secret-view-key))
(key (derive-output-public-key derivation output-index public-spend-key)))
(equalp key output-key)))
(defun output-destination-address (output-key output-index transaction-public-key additional-public-keys subaddress-indexes-table secret-view-key &key (chain :mainnet))
"Return the (sub)address an output is for and a list containing the
subaddress' major index and minor index. If the output is not related to the
SECRET-VIEW-KEY, return NIL and NIL."
(let* ((use-additional-key (> (length additional-public-keys) output-index))
(derivation (derive-key (if use-additional-key
(elt additional-public-keys output-index)
transaction-public-key)
secret-view-key))
(public-spend-key (output-public-key->public-spend-subkey derivation
output-index
output-key))
(indexes (gethash public-spend-key subaddress-indexes-table)))
(when (and use-additional-key (null indexes))
(setf derivation (derive-key transaction-public-key secret-view-key))
(setf public-spend-key (output-public-key->public-spend-subkey derivation
output-index
output-key))
(setf indexes (gethash public-spend-key subaddress-indexes-table)))
(if indexes
(let* ((subaddress-p (notevery #'zerop indexes))
(public-view-key (if subaddress-p
(public-spend-subkey->public-view-subkey secret-view-key
public-spend-key)
(secret-key->public-key secret-view-key)))
(address (encode-address public-spend-key
public-view-key
:subaddress subaddress-p
:chain chain)))
(values address indexes))
(values nil nil))))
(defun decrypt-amount (encrypted-amount output-index transaction-public-key secret-view-key)
"Decrypt a transaction output's ENCRYPTED-AMOUNT."
(let* ((amount (bytes->integer encrypted-amount))
(derivation (derive-key transaction-public-key secret-view-key))
(secret (derivation->scalar derivation output-index))
(amount-mask (bytes->integer (hash-to-scalar (hash-to-scalar secret)))))
(mod (- amount amount-mask) +l+)))
(defun find-extra-field (extra name)
"Return the value matching a specific NAME in the EXTRA field of
a transaction."
(dolist (field extra)
(let ((key (geta field name)))
(when key
(return key)))))
(defun received-amount (transaction address secret-view-key)
"Return the total amount that an ADDRESS received in a TRANSACTION."
(let* ((prefix (geta transaction :prefix))
(outputs (geta prefix :outputs))
(extra (geta prefix :extra))
(transaction-public-key (find-extra-field extra :transaction-public-key))
(additional-public-keys (find-extra-field extra :additional-public-keys))
(rct-signature (geta transaction :rct-signature))
(use-additional-key (and (= (length additional-public-keys) (length outputs))
(geta (decode-address address) :subaddress)))
(received 0))
(dotimes (i (length outputs))
(let* ((output (aref outputs i))
(key (geta (geta output :target) :key)))
(when (output-for-address-p key
i
transaction-public-key
additional-public-keys
address
secret-view-key)
(let ((amount (if (or (null rct-signature)
(eql (geta rct-signature :type) +rct-type-null+))
(geta output :amount)
(let* ((ecdh-info (aref (geta rct-signature :ecdh-info) i))
(encrypted-amount (geta ecdh-info :amount)))
(decrypt-amount encrypted-amount
i
(if use-additional-key
(elt additional-public-keys i)
transaction-public-key)
secret-view-key)))))
(incf received amount)))))
received))
(defun spent-key-images (transaction)
"Return the key images matching the real inputs of a TRANSACTION."
(let ((inputs (geta (geta transaction :prefix) :inputs)))
(map 'list
(lambda (input)
(geta (geta input :key) :key-image))
inputs)))
(defun prove-payment (transaction-hash address transaction-secret-key)
"Prove that a payment to an ADDRESS was made."
(let* ((recipient-public-view-key (geta (decode-address address) :public-view-key))
(key-derivation (point->bytes (point* (bytes->point recipient-public-view-key)
(bytes->integer transaction-secret-key))))
(proof-data (generate-transaction-proof transaction-hash
recipient-public-view-key
key-derivation
transaction-secret-key)))
(concatenate 'string
+payment-proof-header+
(base58-encode key-derivation)
(base58-encode proof-data))))
(defun valid-payment-proof-p (transaction-hash address transaction-public-key proof)
"Return T if PROOF of transaction to an ADDRESS is valid, and NIL
otherwise."
(let ((header-length (length +payment-proof-header+))
(encoded-key-length (base58-encoded-length +key-length+))
(encoded-signature-length (base58-encoded-length (* 2 +key-length+))))
(when (and (= (length proof) (+ header-length encoded-key-length encoded-signature-length))
(string= proof +payment-proof-header+ :end1 header-length))
(let ((recipient-public-view-key (geta (decode-address address) :public-view-key))
(key-derivation (base58-decode (subseq proof
header-length
(+ header-length encoded-key-length))))
(proof-data (base58-decode (subseq proof (+ header-length encoded-key-length)))))
(verify-transaction-proof transaction-hash
recipient-public-view-key
key-derivation
transaction-public-key
proof-data)))))
(defun prove-inbound-transaction-v1 (transaction-hash address message transaction-public-key secret-view-key)
"Prove that a transaction was received by an ADDRESS."
(let* ((address-info (decode-address address))
(subaddress (geta address-info :subaddress))
(public-spend-key (if subaddress
(geta address-info :public-spend-key)
(point->bytes +g+))))
(multiple-value-bind (shared-secret proof)
(generate-inbound-transaction-proof-v1 transaction-hash
transaction-public-key
secret-view-key
public-spend-key
message)
(concatenate 'string
+inbound-transaction-proof-v1-header+
(base58-encode shared-secret)
(base58-encode proof)))))
(defun prove-inbound-transaction-v2 (transaction-hash address message transaction-public-key secret-view-key)
"Prove that a transaction was received by an ADDRESS."
(let* ((address-info (decode-address address))
(subaddress-p (geta address-info :subaddress))
(public-view-key (geta address-info :public-view-key))
(public-spend-key (geta address-info :public-spend-key))
(transaction-public-keys (split-bytes transaction-public-key +key-length+))
(proof (generate-inbound-transaction-proof-v2 transaction-hash
transaction-public-keys
secret-view-key
public-view-key
public-spend-key
subaddress-p
message)))
(concatenate 'string
+inbound-transaction-proof-v2-header+
(base58-encode proof))))
(defun prove-inbound-transaction (transaction-hash address message transaction-public-key secret-view-key)
"Prove that a transaction was received by an ADDRESS."
(prove-inbound-transaction-v2 transaction-hash
address
message
transaction-public-key
secret-view-key))
(defun valid-inbound-transaction-proof-v1-p (transaction-hash address message transaction-public-key proof &optional transaction-secret-key)
"Return T if a PROOF of inbound transaction for an ADDRESS is valid,
and NIL otherwise."
(let ((header-length (length +inbound-transaction-proof-v1-header+))
(encoded-key-length (base58-encoded-length +key-length+))
(encoded-signature-length (base58-encoded-length (* 2 +key-length+))))
(when (and (= (length proof) (+ header-length encoded-key-length encoded-signature-length))
(string= proof +inbound-transaction-proof-v1-header+ :end1 header-length))
(let* ((address-info (decode-address address))
(subaddress (geta address-info :subaddress))
(public-spend-key (if subaddress
(geta address-info :public-spend-key)
(point->bytes +g+)))
(public-view-key (geta address-info :public-view-key))
(shared-secret (base58-decode (subseq proof
header-length
(+ header-length encoded-key-length))))
(signature (base58-decode (subseq proof (+ header-length encoded-key-length)))))
(verify-inbound-transaction-proof-v1 transaction-hash
transaction-public-key
public-view-key
public-spend-key
message
shared-secret
signature
transaction-secret-key)))))
(defun valid-inbound-transaction-proof-v2-p (transaction-hash address message transaction-public-key proof secret-view-key)
"Return T if a PROOF of inbound transaction for an ADDRESS is valid, and NIL
otherwise."
(let* ((header-length (length +inbound-transaction-proof-v2-header+))
(address-info (decode-address address))
(subaddress-p (geta address-info :subaddress))
(public-view-key (geta address-info :public-view-key))
(public-spend-key (geta address-info :public-spend-key))
(transaction-public-keys (split-bytes transaction-public-key +key-length+))
(proof (base58-decode (subseq proof header-length))))
(verify-inbound-transaction-proof-v2 transaction-hash
transaction-public-keys
secret-view-key
public-view-key
public-spend-key
subaddress-p
message
proof)))
(defun valid-inbound-transaction-proof-p (transaction-hash address message transaction-public-key proof secret-view-key)
"Return T if a PROOF of inbound transaction for an ADDRESS is valid, and NIL
otherwise."
(let ((header (subseq proof 0 (min (length +inbound-transaction-proof-v2-header+)
(length proof)))))
(cond
((string= header +inbound-transaction-proof-v1-header+)
(valid-inbound-transaction-proof-v1-p transaction-hash
address
message
transaction-public-key
proof))
((string= header +inbound-transaction-proof-v2-header+)
(valid-inbound-transaction-proof-v2-p transaction-hash
address
message
transaction-public-key
proof
secret-view-key)))))
(defun prove-outbound-transaction-v1 (transaction-hash address message transaction-secret-key)
"Prove that a transaction was send to an ADDRESS."
(let* ((address-info (decode-address address))
(subaddress (geta address-info :subaddress))
(public-spend-key (if subaddress
(geta address-info :public-spend-key)
(point->bytes +g+)))
(public-view-key (geta address-info :public-view-key)))
(multiple-value-bind (shared-secret proof)
(generate-outbound-transaction-proof-v1 transaction-hash
transaction-secret-key
public-view-key
public-spend-key
message)
(concatenate 'string
+outbound-transaction-proof-v1-header+
(base58-encode shared-secret)
(base58-encode proof)))))
(defun prove-outbound-transaction-v2 (transaction-hash address message transaction-secret-key)
"Prove that a transaction was send to an ADDRESS."
(let* ((address-info (decode-address address))
(subaddress-p (geta address-info :subaddress))
(public-view-key (geta address-info :public-view-key))
(public-spend-key (geta address-info :public-spend-key))
(transaction-secret-keys (split-bytes transaction-secret-key +key-length+))
(proof (generate-outbound-transaction-proof-v2 transaction-hash
transaction-secret-keys
public-view-key
public-spend-key
subaddress-p
message)))
(concatenate 'string
+outbound-transaction-proof-v2-header+
(base58-encode proof))))
(defun prove-outbound-transaction (transaction-hash address message transaction-secret-key)
"Prove that a transaction was send to an ADDRESS."
(prove-outbound-transaction-v2 transaction-hash
address
message
transaction-secret-key))
(defun valid-outbound-transaction-proof-v1-p (transaction-hash address message transaction-public-key proof &optional secret-view-key)
"Return T if a PROOF of outbound transaction for an ADDRESS is
valid, and NIL otherwise."
(let ((header-length (length +outbound-transaction-proof-v1-header+))
(encoded-key-length (base58-encoded-length +key-length+))
(encoded-signature-length (base58-encoded-length (* 2 +key-length+))))
(when (and (= (length proof) (+ header-length encoded-key-length encoded-signature-length))
(string= proof +outbound-transaction-proof-v1-header+ :end1 header-length))
(let* ((address-info (decode-address address))
(subaddress (geta address-info :subaddress))
(public-spend-key (if subaddress
(geta address-info :public-spend-key)
(point->bytes +g+)))
(public-view-key (geta address-info :public-view-key))
(shared-secret (base58-decode (subseq proof
header-length
(+ header-length encoded-key-length))))
(signature (base58-decode (subseq proof (+ header-length encoded-key-length)))))
(verify-outbound-transaction-proof-v1 transaction-hash
transaction-public-key
public-view-key
public-spend-key
message
shared-secret
signature
secret-view-key)))))
(defun valid-outbound-transaction-proof-v2-p (transaction-hash address message transaction-public-key proof secret-view-key)
"Return T if a PROOF of outbound transaction for an ADDRESS is valid, and NIL
otherwise."
(let* ((header-length (length +outbound-transaction-proof-v2-header+))
(address-info (decode-address address))
(subaddress-p (geta address-info :subaddress))
(public-view-key (geta address-info :public-view-key))
(public-spend-key (geta address-info :public-spend-key))
(transaction-public-keys (split-bytes transaction-public-key +key-length+))
(proof (base58-decode (subseq proof header-length))))
(verify-outbound-transaction-proof-v2 transaction-hash
transaction-public-keys
secret-view-key
public-view-key
public-spend-key
subaddress-p
message
proof)))
(defun valid-outbound-transaction-proof-p (transaction-hash address message transaction-public-key proof secret-view-key)
"Return T if a PROOF of outbound transaction for an ADDRESS is valid, and NIL
otherwise."
(let ((header (subseq proof 0 (min (length +outbound-transaction-proof-v2-header+)
(length proof)))))
(cond
((string= header +outbound-transaction-proof-v1-header+)
(valid-outbound-transaction-proof-v1-p transaction-hash
address
message
transaction-public-key
proof
secret-view-key))
((string= header +outbound-transaction-proof-v2-header+)
(valid-outbound-transaction-proof-v2-p transaction-hash
address
message
transaction-public-key
proof
secret-view-key)))))
| 22,255 | Common Lisp | .lisp | 358 | 41.427374 | 168 | 0.538841 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 9c9d91c08be67652cf9c218609e1a714204c116e358b2ed4b3900191b20b587f | 8,065 | [
-1
] |
8,066 | signature.lisp | glv2_cl-monero-tools/monero-tools/wallet/signature.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(define-constant +message-signature-header+ "SigV1" :test #'string=)
(defun sign-message (message secret-spend-key)
"Return a signature of a MESSAGE by a SECRET-SPEND-KEY."
(let* ((hash (fast-hash (utf-8-string->bytes message)))
(signature-data (generate-signature hash secret-spend-key)))
(concatenate 'string +message-signature-header+ (base58-encode signature-data))))
(defun valid-message-signature-p (message address signature)
"Return T if a SIGNATURE of a MESSAGE by the secret key matching
an ADDRESS is valid, and NIL otherwise."
(let ((header-length (length +message-signature-header+))
(encoded-signature-length (base58-encoded-length (* 2 +key-length+))))
(when (and (= (length signature) (+ header-length encoded-signature-length))
(string= signature +message-signature-header+ :end1 header-length))
(let ((hash (fast-hash (utf-8-string->bytes message)))
(public-key (geta (decode-address address) :public-spend-key))
(signature-data (base58-decode (subseq signature header-length))))
(valid-signature-p hash public-key signature-data)))))
(defun sign-file (file secret-spend-key)
"Return a signature of a FILE by a SECRET-SPEND-KEY."
(let* ((hash (fast-hash (read-file-into-byte-vector file)))
(signature-data (generate-signature hash secret-spend-key)))
(concatenate 'string +message-signature-header+ (base58-encode signature-data))))
(defun valid-file-signature-p (file address signature)
"Return T if a SIGNATURE of a FILE by the secret key matching
an ADDRESS is valid, and NIL otherwise."
(let ((header-length (length +message-signature-header+))
(encoded-signature-length (base58-encoded-length (* 2 +key-length+))))
(when (and (= (length signature) (+ header-length encoded-signature-length))
(string= signature +message-signature-header+ :end1 header-length))
(let ((hash (fast-hash (read-file-into-byte-vector file)))
(public-key (geta (decode-address address) :public-spend-key))
(signature-data (base58-decode (subseq signature header-length))))
(valid-signature-p hash public-key signature-data)))))
| 2,429 | Common Lisp | .lisp | 38 | 58.184211 | 85 | 0.707092 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 975012dce6d8d259035f4b1f297022b2b36f4cd47db4bfeedf4602b28eccf285 | 8,066 | [
-1
] |
8,067 | multisig.lisp | glv2_cl-monero-tools/monero-tools/wallet/multisig.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(define-constant +multisig-info-header+ "MultisigV1" :test #'string=)
(define-constant +multisig-extra-info-header+ "MultisigxV1" :test #'string=)
(defun make-multisig-info (secret-view-key secret-spend-key)
"Return the info of a multi-signature wallet encoded as a string."
(let* ((blinded-secret-view-key (compute-multisig-blinded-secret secret-view-key))
(secret-signer-key (compute-multisig-blinded-secret secret-spend-key))
(public-signer-key (secret-key->public-key secret-signer-key))
(data (concatenate 'octet-vector blinded-secret-view-key public-signer-key))
(hash (fast-hash data))
(signature (generate-signature hash secret-signer-key))
(data (concatenate 'octet-vector data signature)))
(concatenate 'string +multisig-info-header+ (base58-encode data))))
(defun decode-multisig-info (multisig-info)
"Return an alist containing the components of the MULTISIG-INFO string."
(let ((header-length (length +multisig-info-header+))
(encoded-data-length (base58-encoded-length (* 4 +key-length+))))
(if (not (and (= (length multisig-info) (+ header-length encoded-data-length))
(string= multisig-info +multisig-info-header+ :end1 header-length)))
(error "Invalid multisig info.")
(let* ((data (base58-decode (subseq multisig-info header-length)))
(secret-view-key (subseq data 0 +key-length+))
(public-signer-key (subseq data +key-length+ (* 2 +key-length+)))
(hash (fast-hash (subseq data 0 (* 2 +key-length+))))
(signature (subseq data (* 2 +key-length+))))
(if (not (valid-signature-p hash public-signer-key signature))
(error "Invalid multisig info.")
(list (cons :secret-view-key secret-view-key)
(cons :public-signer-key public-signer-key)))))))
(defun make-multisig-extra-info (multisig-keys)
"Return the extra info of a multi-signature wallet encoded as a string."
(let* ((secret-signer-key (compute-multisig-secret-spend-key multisig-keys))
(public-signer-key (secret-key->public-key secret-signer-key))
(multisig-public-keys (compute-multisig-public-keys multisig-keys))
(data (concatenate 'octet-vector
public-signer-key
(with-octet-output-stream (result)
(map nil (lambda (x) (write-sequence x result)) multisig-public-keys))))
(hash (fast-hash data))
(signature (generate-signature hash secret-signer-key))
(data (concatenate 'octet-vector data signature)))
(concatenate 'string +multisig-extra-info-header+ (base58-encode data))))
(defun decode-multisig-extra-info (multisig-extra-info)
"Return an alist containing the components of the MULTISIG-EXTRA-INFO string."
(let ((header-length (length +multisig-extra-info-header+))
(min-encoded-data-length (base58-encoded-length (* 4 +key-length+))))
(if (not (and (>= (length multisig-extra-info) (+ header-length min-encoded-data-length))
(string= multisig-extra-info +multisig-extra-info-header+ :end1 header-length)))
(error "Invalid multisig extra info.")
(let* ((data (base58-decode (subseq multisig-extra-info header-length)))
(public-signer-key (subseq data 0 +key-length+))
(keys-data-length (- (length data) (* 3 +key-length+)))
(multisig-public-keys-data (subseq data +key-length+ (+ +key-length+ keys-data-length)))
(hash (fast-hash (subseq data 0 (+ +key-length+ keys-data-length))))
(signature (subseq data (+ +key-length+ keys-data-length))))
(if (not (and (zerop (mod keys-data-length +key-length+))
(valid-signature-p hash public-signer-key signature)))
(error "Invalid multisig extra info.")
(let ((keys (iter (for i from 0 below keys-data-length by +key-length+)
(collect (subseq multisig-public-keys-data i (+ i +key-length+))))))
(list (cons :public-signer-key public-signer-key)
(cons :multisig-public-keys (coerce keys 'vector)))))))))
(defun make-multisig-seed (threshold total secret-spend-key public-spend-key secret-view-key public-view-key multisig-keys multisig-signers)
"Encode the all the info about a multisig wallet as a hex string."
(with-octet-output-stream (result)
(write-sequence (integer->bytes threshold :size 4) result)
(write-sequence (integer->bytes total :size 4) result)
(write-sequence secret-spend-key result)
(write-sequence public-spend-key result)
(write-sequence secret-view-key result)
(write-sequence public-view-key result)
(map nil (lambda (x) (write-sequence x result)) multisig-keys)
(map nil (lambda (x) (write-sequence x result)) multisig-signers)))
(defun decode-multisig-seed (multisig-seed)
"Return an alist containing the components of the MULTISIG-SEED hex string."
(let ((seed (hex-string->bytes multisig-seed)))
(if (< (length seed) 8)
(error "Invalid multisig seed.")
(let* ((threshold (bytes->integer seed :end 4))
(total (bytes->integer seed :start 4 :end 8))
(multisig-keys-length (if (= threshold total) 1 (1- total))))
(if (not (and (<= 2 threshold total)
(= (length seed) (+ 8 (* +key-length+ (+ 4 multisig-keys-length total))))))
(error "Invalid multisig seed.")
(let* ((secret-spend-key (subseq seed 8 (+ 8 +key-length+)))
(offset (+ 8 +key-length+))
(public-spend-key (subseq seed offset (+ offset +key-length+)))
(offset (+ offset +key-length+))
(secret-view-key (subseq seed offset (+ offset +key-length+)))
(offset (+ offset +key-length+))
(public-view-key (subseq seed offset (+ offset +key-length+)))
(offset (+ offset +key-length+))
(offset1 (+ offset (* multisig-keys-length +key-length+)))
(multisig-keys (iter (for i from offset below offset1 by +key-length+)
(collect (subseq seed i (+ i +key-length+)) result-type 'vector)))
(signers (iter (for i from offset1 below (length seed) by +key-length+)
(collect (subseq seed i (+ i +key-length+)) result-type 'vector))))
(if (not (and (equalp public-view-key (secret-key->public-key secret-view-key))
(find (secret-key->public-key secret-spend-key) signers :test #'equalp)
(equalp secret-spend-key
(compute-multisig-secret-spend-key multisig-keys))))
(error "Invalid multisig seed.")
(list (cons :threshold threshold)
(cons :total total)
(cons :secret-spend-key secret-spend-key)
(cons :public-spend-key public-spend-key)
(cons :secret-view-key secret-view-key)
(cons :public-view-key public-view-key)
(cons :multisig-keys multisig-keys)
(cons :signers signers)))))))))
#|
n/n multisig wallet
-------------------
(let* ((secret-spend-key (generate-secret-key))
(secret-view-key (secret-spend-key->secret-view-key secret-spend-key))
(multisig-info (make-multisig-info secret-view-key secret-spend-key))
(decoded-multisig-info (decode-multisig-info multisig-info))
(blinded-secret-view-key (geta decoded-multisig-info :secret-view-key))
(public-signer-key (geta decoded-multisig-info :public-signer-key)))
(send-to-other-multisig-signers multisig-info)
(let* ((other-signers-multisig-info (receive-info-from-other-multisig-signers))
(other-signers-multisig-info (map 'vector
#'decode-multisig-info
other-signers-multisig-info))
(other-secret-view-keys (map 'vector
(lambda (multisig-info)
(geta multisig-info :secret-view-key))
other-signers-multisig-info))
(other-public-signer-keys (map 'vector
(lambda (multisig-info)
(geta multisig-info :public-signer-key))
other-signers-multisig-info))
(secret-view-keys (concatenate 'vector
(vector blinded-secret-view-key)
other-secret-view-keys))
(public-signer-keys (concatenate 'vector
(vector public-signer-key)
other-public-signer-keys))
(multisig-keys (compute-multisig-keys-n/n secret-spend-key))
(multisig-secret-view-key (compute-multisig-secret-view-key secret-view-keys))
(multisig-public-view-key (secret-key->public-key multisig-secret-view-key))
(multisig-secret-spend-key (compute-multisig-secret-spend-key multisig-keys))
(multisig-public-spend-key (compute-multisig-public-spend-key public-signer-keys)))
(make-multisig-seed n
n
multisig-secret-spend-key
multisig-public-spend-key
multisig-secret-view-key
multisig-public-view-key
multisig-keys
public-signer-keys)))
m/n multisig wallet
-------------------
(let* ((secret-spend-key (generate-secret-key))
(secret-view-key (secret-spend-key->secret-view-key secret-spend-key))
(multisig-info (make-multisig-info secret-view-key secret-spend-key))
(decoded-multisig-info (decode-multisig-info multisig-info))
(blinded-secret-view-key (geta decoded-multisig-info :secret-view-key))
(public-signer-key (geta decoded-multisig-info :public-signer-key)))
(send-to-other-multisig-signers multisig-info)
(let* ((other-signers-multisig-info (receive-info-from-other-multisig-signers))
(other-signers-multisig-info (map 'vector
#'decode-multisig-info
other-signers-multisig-info))
(other-secret-view-keys (map 'vector
(lambda (multisig-info)
(geta multisig-info :secret-view-key))
other-signers-multisig-info))
(other-public-signer-keys (map 'vector
(lambda (multisig-info)
(geta multisig-info :public-signer-key))
other-signers-multisig-info))
(multisig-keys (compute-multisig-keys-m/n other-public-signer-keys))
(multisig-extra-info (make-multisig-extra-info multisig-keys))
(public-signer-key (geta multisig-extra-info :public-signer-key))
(multisig-public-keys (geta multisig-extra-info :multisig-public-keys)))
(send-to-other-multisig-signers multisig-extra-info)
(let* ((other-signers-multisig-extra-info (receive-extra-info-from-other-multisig-signers))
(other-signers-multisig-extra-info (map 'vector
#'decode-multisig-extra-info
other-signers-multisig-extra-info))
(other-public-signer-keys (map 'vector
(lambda (multisig-extra-info)
(geta multisig-extra-info :public-signer-key))
other-signers-multisig-extra-info))
(other-multisig-public-keys (map 'vector
(lambda (multisig-extra-info)
(geta multisig-extra-info :multisig-public-keys))
other-signers-multisig-extra-info))
(secret-view-keys (concatenate 'vector
(vector blinded-secret-view-key)
other-secret-view-keys))
(public-signer-keys (concatenate 'vector
(vector public-signer-key)
other-public-signer-keys))
(multisig-public-keys (reduce (lambda (x y)
(remove-duplicates (concatenate 'vector x y)
:test (complement #'mismatch)))
other-multisig-public-keys
:initial-value multisig-public-keys))
(multisig-secret-view-key (compute-multisig-secret-view-key secret-view-keys))
(multisig-public-view-key (secret-key->public-key multisig-secret-view-key))
(multisig-secret-spend-key (compute-multisig-secret-spend-key multisig-keys))
(multisig-public-spend-key (compute-multisig-public-spend-key multisig-public-keys)))
(make-multisig-seed m
n
multisig-secret-spend-key
multisig-public-spend-key
multisig-secret-view-key
multisig-public-view-key
multisig-keys
public-signer-keys))))
|#
| 14,227 | Common Lisp | .lisp | 217 | 47.663594 | 140 | 0.564366 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 9a0a103fcb1db5f7e14f1e184c8c40944ec10d884e3289b2b6a4d10a9aef0483 | 8,067 | [
-1
] |
8,068 | wallet-file.lisp | glv2_cl-monero-tools/monero-tools/wallet/wallet-file.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun decrypt-wallet-keys (keys-file password &key chacha8)
"Get the info from an encrypted KEYS-FILE. Set CHACHA8 to T if the wallet was
encrypted with chacha8 instead of chacha20."
(let* ((keys-file-data (read-file-into-byte-vector keys-file))
(iv (subseq keys-file-data 0 +chacha-iv-length+)))
(multiple-value-bind (encrypted-data-length varint-size)
(deserialize-integer keys-file-data +chacha-iv-length+)
(let* ((start (+ +chacha-iv-length+ varint-size))
(end (+ start encrypted-data-length))
(encrypted-data (subseq keys-file-data start end))
(key (generate-chacha-key password))
(json-string (bytes->string (if chacha8
(chacha8 encrypted-data key iv)
(chacha20 encrypted-data key iv))))
(info (handler-case
(decode-json-from-string json-string)
(t ()
(error "Bad password."))))
(key-data (string->bytes (geta info :key-data)))
(keys (deserialize-from-binary-storage key-data 0))
(m-keys (geta keys :m-keys))
(m-account-address (geta m-keys :m-account-address)))
(flet ((convert-value (assoc key)
(let ((v (geta assoc key)))
(when v
(setf (geta assoc key) (string->bytes v))))))
(convert-value m-account-address :m-spend-public-key)
(convert-value m-account-address :m-view-public-key)
(convert-value m-keys :m-encryption-iv)
(convert-value m-keys :m-spend-secret-key)
(convert-value m-keys :m-view-secret-key))
(setf (geta info :key-data) keys)
info))))
(defun get-wallet-keys (keys-file password &key chacha8)
"Get the wallet view keys and spend keys from an encrypted KEYS-FILE. Set
CHACHA8 to T if the wallet was encrypted with chacha8 instead of chacha20."
(let* ((info (decrypt-wallet-keys keys-file password :chacha8 chacha8))
(keys (geta (geta info :key-data) :m-keys))
(account-address (geta keys :m-account-address)))
(flet ((get-value (keyword assoc key)
(let ((v (geta assoc key)))
(when v
(list (cons keyword v))))))
(append (get-value :public-spend-key account-address :m-spend-public-key)
(get-value :public-view-key account-address :m-view-public-key)
(get-value :secret-spend-key keys :m-spend-secret-key)
(get-value :secret-view-key keys :m-view-secret-key)))))
(defparameter *bruteforce-dictionary* nil)
(defparameter *bruteforce-state* nil)
(defparameter *bruteforce-stop* nil)
(defparameter *bruteforce-result* nil)
(defparameter *bruteforce-lock* nil)
(defun bruteforce-wallet-keys (keys-file &key (threads 1) dictionary-file (characters " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~") (minimum-length 1) (maximum-length 8) prefix suffix chacha8)
"Try to find the password and keys of an encrypted KEYS-FILE either
using a DICTIONARY-FILE, or by trying all the passwords composed of
some CHARACTERS, having a length between MINIMUM-LENGTH and
MAXIMUM-LENGTH, starting with PREFIX and ending with SUFFIX. Several
THREADS can be used to go faster. Set CHACHA8 to T if the wallet was
encrypted with chacha8 instead of chacha20."
(when *bruteforce-lock*
(error "bruteforce-wallet-keys is already running."))
(unwind-protect
(progn
(setf *bruteforce-lock* (make-lock))
(if dictionary-file
(setf *bruteforce-dictionary* #-ccl (open dictionary-file)
#+ccl (open dictionary-file :sharing :external))
(setf *bruteforce-state* (make-array (1+ (- minimum-length (length prefix) (length suffix)))
:initial-element 0)))
(labels ((read-dictionary-line ()
(when *bruteforce-dictionary*
(let (password)
(with-lock-held (*bruteforce-lock*)
(setf password (read-line *bruteforce-dictionary* nil nil))
(unless password
(setf *bruteforce-stop* t)))
(when (plusp (length password))
password))))
(generate-next-password ()
(let (password)
(with-lock-held (*bruteforce-lock*)
(let ((len (1- (length *bruteforce-state*))))
(if (> len (- maximum-length (length prefix) (length suffix)))
(setf *bruteforce-stop* t)
(let ((charset-len (length characters)))
(setf password (iter (for i from 0 below len)
(collect (aref characters (aref *bruteforce-state* (- len 1 i))))))
;; Prepare next password
(incf (aref *bruteforce-state* 0))
(when (= (aref *bruteforce-state* 0) charset-len)
(setf (aref *bruteforce-state* 0) 0))
(let ((i 0))
(iter (while (and (< i len) (zerop (aref *bruteforce-state* i))))
(incf i)
(incf (aref *bruteforce-state* i))
(when (= (aref *bruteforce-state* i) charset-len)
(setf (aref *bruteforce-state* i) 0))))
(when (plusp (aref *bruteforce-state* len))
(setf *bruteforce-state* (make-array (+ len 2) :initial-element 0)))))))
(when (plusp (length password))
(concatenate 'string prefix password suffix))))
(bruteforce ()
(iter (until *bruteforce-stop*)
(let* ((password (if *bruteforce-dictionary*
(read-dictionary-line)
(generate-next-password)))
(keys (handler-case (get-wallet-keys keys-file password :chacha8 chacha8)
(t () nil))))
(when keys
(with-lock-held (*bruteforce-lock*)
(setf *bruteforce-stop* t)
(setf *bruteforce-result* (acons :password password keys))))))))
(let ((thread-handles (make-array threads)))
(dotimes (i threads)
(setf (aref thread-handles i) (make-thread #'bruteforce)))
(dotimes (i threads)
(join-thread (aref thread-handles i))))
*bruteforce-result*))
(when *bruteforce-dictionary*
(close *bruteforce-dictionary*)
(setf *bruteforce-dictionary* nil))
(setf *bruteforce-state* nil)
(setf *bruteforce-stop* nil)
(setf *bruteforce-lock* nil)
(setf *bruteforce-result* nil)))
(defun decrypt-wallet-cache (cache-file password &key keys-file chacha8 old-scheme (rounds 1))
(let* ((keys-file (or keys-file (concatenate 'string cache-file ".keys")))
(key (if (or chacha8 old-scheme)
(let* ((wallet-keys (get-wallet-keys keys-file password :chacha8 chacha8))
(secret-view-key (geta wallet-keys :secret-view-key))
(secret-spend-key (geta wallet-keys :secret-spend-key)))
(generate-chacha-key-from-secret-keys secret-view-key secret-spend-key))
(generate-cache-chacha-key password rounds)))
(cache-file-data (read-file-into-byte-vector cache-file))
(iv (subseq cache-file-data 0 +chacha-iv-length+)))
(multiple-value-bind (encrypted-data-length varint-size)
(deserialize-integer cache-file-data +chacha-iv-length+)
(let* ((start (+ +chacha-iv-length+ varint-size))
(end (+ +chacha-iv-length+ varint-size encrypted-data-length))
(encrypted-data (subseq cache-file-data start end))
(data (if chacha8
(chacha8 encrypted-data key iv)
(chacha20 encrypted-data key iv))))
;; TODO: deserialize data
(let* ((header (subseq data 0 24))
(data (subseq data 24)))
(subseq data 0 1024))))))
| 8,989 | Common Lisp | .lisp | 152 | 42.401316 | 247 | 0.544239 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 977d80946cd1eee3c50e76a50bbd5b94d33828710bd5af7865c1cd472546cad6 | 8,068 | [
-1
] |
8,069 | openalias.lisp | glv2_cl-monero-tools/monero-tools/openalias/openalias.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun normalize-openalias-address (address)
(substitute #\. #\@ address))
(defun get-openalias-info (address)
"Return an alist containing the openalias information of an ADDRESS. The
second returned value is T is the validity of the information has been verified
by DNSSEC, and NIL otherwise. The trust anchors used for DNSSEC validation are
specified in the *DNSSEC-TRUST-ANCHORS* parameter."
(multiple-value-bind (text validated)
(get-monero-txt-record (normalize-openalias-address address))
(flet ((get-field (name)
(let* ((regexp (format nil "~a=(.*?);" name))
(fields (nth-value 1 (cl-ppcre:scan-to-strings regexp text))))
(when fields
(aref fields 0)))))
(let ((address (get-field "recipient_address"))
(recipient-name (get-field "recipient_name"))
(description (get-field "tx_description"))
(payment-id (get-field "tx_payment_id"))
(amount (get-field "tx_amount")))
(values (append (when address
(list (cons :address address)))
(when recipient-name
(list (cons :recipient-name recipient-name)))
(when description
(list (cons :description description)))
(when payment-id
(list (cons :payment-id payment-id)))
(when amount
(list (cons :amount amount))))
validated)))))
| 1,782 | Common Lisp | .lisp | 35 | 38.771429 | 82 | 0.588404 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 24403500c20973fc5ff00f080056456024aacc4c0bb2eba87ea81336639554b8 | 8,069 | [
-1
] |
8,070 | dns.lisp | glv2_cl-monero-tools/monero-tools/openalias/dns.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(define-foreign-library unbound
(t (:default "libunbound")))
(handler-case
(use-foreign-library unbound)
(load-foreign-library-error ()
(warn "The unbound library was not found.")))
(defcstruct ub-result
(qname :pointer)
(qtype :int)
(qclass :int)
(data :pointer)
(len :pointer)
(canonname :pointer)
(rcode :int)
(answer-packet :pointer)
(answer-len :int)
(havedata :int)
(nxdomain :int)
(secure :int)
(bogus :int)
(why-bogus :pointer)
(ttl :int))
(defparameter *dns-server* nil
"Server to forward DNS queries to. If NIL, use what the operating
system uses")
(defparameter *dnssec-trust-anchors*
(list ". IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5"
". IN DS 20326 8 2 E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D")
"Trust anchors used for DNSSEC validation. The format is a list of strings,
similar to the zone-file format, [domainname] [type] [rdata contents]. Both DS
and DNSKEY records are accepted.")
(defun get-monero-txt-record (name)
"Make a DNS query for NAME and return the Monero TXT record. The second
returned value is T if the DNS answer was validated by DNSSEC, and NIL
otherwise. The DNS query is forwarded to *DNS-SERVER*. The trust anchors used
for DNSSEC validation are specified in the *DNSSEC-TRUST-ANCHORS* parameter."
(if (foreign-library-loaded-p 'unbound)
(let* ((context (foreign-funcall "ub_ctx_create" :pointer))
(text nil)
(validated nil))
(unless (pointer-eq context (null-pointer))
(with-foreign-object (result :pointer)
(if *dns-server*
(progn
(foreign-funcall "ub_ctx_set_fwd"
:pointer context
:string *dns-server*
:int)
(foreign-funcall "ub_ctx_set_option"
:pointer context
:string "do-udp:"
:string "no")
(foreign-funcall "ub_ctx_set_option"
:pointer context
:string "do-tcp:"
:string "yes"))
(progn
(foreign-funcall "ub_ctx_resolvconf"
:pointer context
:pointer (null-pointer)
:int)
(foreign-funcall "ub_ctx_hosts"
:pointer context
:pointer (null-pointer)
:int)))
(dolist (trust-anchor *dnssec-trust-anchors*)
(foreign-funcall "ub_ctx_add_ta"
:pointer context
:string trust-anchor
:int))
(foreign-funcall "ub_resolve"
:pointer context
:string name
:int 16 ; type TXT
:int 1 ; class IN
:pointer result
:int)
(unless (pointer-eq result (null-pointer))
(with-foreign-slots ((data len secure) (mem-ref result :pointer) (:struct ub-result))
(setf validated (= secure 1))
(setf text (do* ((i 0 (1+ i))
(record (mem-aref data :pointer i) (mem-aref data :pointer i)))
((null-pointer-p record))
(let* ((size (1- (mem-aref len :int i)))
(record-bytes (c-array->lisp-array (inc-pointer record 1) size))
(record-text (bytes->utf-8-string record-bytes)))
(when (and (>= size 8)
(string= record-text "oa1:xmr " :end1 8))
(return (subseq record-text 8)))))))
(foreign-funcall "ub_resolve_free"
:pointer (mem-ref result :pointer))))
(foreign-funcall "ub_ctx_delete"
:pointer context))
(values text validated))
(error "DNS queries not supported because the unbound library was not found.")))
| 4,694 | Common Lisp | .lisp | 100 | 30.85 | 100 | 0.510578 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | f50a622a29ad0e19e16df95a72ef2ebd26b9bf5c664a4948f34a21130e2131df | 8,070 | [
-1
] |
8,071 | portuguese.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/portuguese.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :portuguese
4
#("abaular"
"abdominal"
"abeto"
"abissinio"
"abjeto"
"ablucao"
"abnegar"
"abotoar"
"abrutalhar"
"absurdo"
"abutre"
"acautelar"
"accessorios"
"acetona"
"achocolatado"
"acirrar"
"acne"
"acovardar"
"acrostico"
"actinomicete"
"acustico"
"adaptavel"
"adeus"
"adivinho"
"adjunto"
"admoestar"
"adnominal"
"adotivo"
"adquirir"
"adriatico"
"adsorcao"
"adutora"
"advogar"
"aerossol"
"afazeres"
"afetuoso"
"afixo"
"afluir"
"afortunar"
"afrouxar"
"aftosa"
"afunilar"
"agentes"
"agito"
"aglutinar"
"aiatola"
"aimore"
"aino"
"aipo"
"airoso"
"ajeitar"
"ajoelhar"
"ajudante"
"ajuste"
"alazao"
"albumina"
"alcunha"
"alegria"
"alexandre"
"alforriar"
"alguns"
"alhures"
"alivio"
"almoxarife"
"alotropico"
"alpiste"
"alquimista"
"alsaciano"
"altura"
"aluviao"
"alvura"
"amazonico"
"ambulatorio"
"ametodico"
"amizades"
"amniotico"
"amovivel"
"amurada"
"anatomico"
"ancorar"
"anexo"
"anfora"
"aniversario"
"anjo"
"anotar"
"ansioso"
"anturio"
"anuviar"
"anverso"
"anzol"
"aonde"
"apaziguar"
"apito"
"aplicavel"
"apoteotico"
"aprimorar"
"aprumo"
"apto"
"apuros"
"aquoso"
"arauto"
"arbusto"
"arduo"
"aresta"
"arfar"
"arguto"
"aritmetico"
"arlequim"
"armisticio"
"aromatizar"
"arpoar"
"arquivo"
"arrumar"
"arsenio"
"arturiano"
"aruaque"
"arvores"
"asbesto"
"ascorbico"
"aspirina"
"asqueroso"
"assustar"
"astuto"
"atazanar"
"ativo"
"atletismo"
"atmosferico"
"atormentar"
"atroz"
"aturdir"
"audivel"
"auferir"
"augusto"
"aula"
"aumento"
"aurora"
"autuar"
"avatar"
"avexar"
"avizinhar"
"avolumar"
"avulso"
"axiomatico"
"azerbaijano"
"azimute"
"azoto"
"azulejo"
"bacteriologista"
"badulaque"
"baforada"
"baixote"
"bajular"
"balzaquiana"
"bambuzal"
"banzo"
"baoba"
"baqueta"
"barulho"
"bastonete"
"batuta"
"bauxita"
"bavaro"
"bazuca"
"bcrepuscular"
"beato"
"beduino"
"begonia"
"behaviorista"
"beisebol"
"belzebu"
"bemol"
"benzido"
"beocio"
"bequer"
"berro"
"besuntar"
"betume"
"bexiga"
"bezerro"
"biatlon"
"biboca"
"bicuspide"
"bidirecional"
"bienio"
"bifurcar"
"bigorna"
"bijuteria"
"bimotor"
"binormal"
"bioxido"
"bipolarizacao"
"biquini"
"birutice"
"bisturi"
"bituca"
"biunivoco"
"bivalve"
"bizarro"
"blasfemo"
"blenorreia"
"blindar"
"bloqueio"
"blusao"
"boazuda"
"bofete"
"bojudo"
"bolso"
"bombordo"
"bonzo"
"botina"
"boquiaberto"
"bostoniano"
"botulismo"
"bourbon"
"bovino"
"boximane"
"bravura"
"brevidade"
"britar"
"broxar"
"bruno"
"bruxuleio"
"bubonico"
"bucolico"
"buda"
"budista"
"bueiro"
"buffer"
"bugre"
"bujao"
"bumerangue"
"burundines"
"busto"
"butique"
"buzios"
"caatinga"
"cabuqui"
"cacunda"
"cafuzo"
"cajueiro"
"camurca"
"canudo"
"caquizeiro"
"carvoeiro"
"casulo"
"catuaba"
"cauterizar"
"cebolinha"
"cedula"
"ceifeiro"
"celulose"
"cerzir"
"cesto"
"cetro"
"ceus"
"cevar"
"chavena"
"cheroqui"
"chita"
"chovido"
"chuvoso"
"ciatico"
"cibernetico"
"cicuta"
"cidreira"
"cientistas"
"cifrar"
"cigarro"
"cilio"
"cimo"
"cinzento"
"cioso"
"cipriota"
"cirurgico"
"cisto"
"citrico"
"ciumento"
"civismo"
"clavicula"
"clero"
"clitoris"
"cluster"
"coaxial"
"cobrir"
"cocota"
"codorniz"
"coexistir"
"cogumelo"
"coito"
"colusao"
"compaixao"
"comutativo"
"contentamento"
"convulsivo"
"coordenativa"
"coquetel"
"correto"
"corvo"
"costureiro"
"cotovia"
"covil"
"cozinheiro"
"cretino"
"cristo"
"crivo"
"crotalo"
"cruzes"
"cubo"
"cucuia"
"cueiro"
"cuidar"
"cujo"
"cultural"
"cunilingua"
"cupula"
"curvo"
"custoso"
"cutucar"
"czarismo"
"dablio"
"dacota"
"dados"
"daguerreotipo"
"daiquiri"
"daltonismo"
"damista"
"dantesco"
"daquilo"
"darwinista"
"dasein"
"dativo"
"deao"
"debutantes"
"decurso"
"deduzir"
"defunto"
"degustar"
"dejeto"
"deltoide"
"demover"
"denunciar"
"deputado"
"deque"
"dervixe"
"desvirtuar"
"deturpar"
"deuteronomio"
"devoto"
"dextrose"
"dezoito"
"diatribe"
"dicotomico"
"didatico"
"dietista"
"difuso"
"digressao"
"diluvio"
"diminuto"
"dinheiro"
"dinossauro"
"dioxido"
"diplomatico"
"dique"
"dirimivel"
"disturbio"
"diurno"
"divulgar"
"dizivel"
"doar"
"dobro"
"docura"
"dodoi"
"doer"
"dogue"
"doloso"
"domo"
"donzela"
"doping"
"dorsal"
"dossie"
"dote"
"doutro"
"doze"
"dravidico"
"dreno"
"driver"
"dropes"
"druso"
"dubnio"
"ducto"
"dueto"
"dulija"
"dundum"
"duodeno"
"duquesa"
"durou"
"duvidoso"
"duzia"
"ebano"
"ebrio"
"eburneo"
"echarpe"
"eclusa"
"ecossistema"
"ectoplasma"
"ecumenismo"
"eczema"
"eden"
"editorial"
"edredom"
"edulcorar"
"efetuar"
"efigie"
"efluvio"
"egiptologo"
"egresso"
"egua"
"einsteiniano"
"eira"
"eivar"
"eixos"
"ejetar"
"elastomero"
"eldorado"
"elixir"
"elmo"
"eloquente"
"elucidativo"
"emaranhar"
"embutir"
"emerito"
"emfa"
"emitir"
"emotivo"
"empuxo"
"emulsao"
"enamorar"
"encurvar"
"enduro"
"enevoar"
"enfurnar"
"enguico"
"enho"
"enigmista"
"enlutar"
"enormidade"
"enpreendimento"
"enquanto"
"enriquecer"
"enrugar"
"entusiastico"
"enunciar"
"envolvimento"
"enxuto"
"enzimatico"
"eolico"
"epiteto"
"epoxi"
"epura"
"equivoco"
"erario"
"erbio"
"ereto"
"erguido"
"erisipela"
"ermo"
"erotizar"
"erros"
"erupcao"
"ervilha"
"esburacar"
"escutar"
"esfuziante"
"esguio"
"esloveno"
"esmurrar"
"esoterismo"
"esperanca"
"espirito"
"espurio"
"essencialmente"
"esturricar"
"esvoacar"
"etario"
"eterno"
"etiquetar"
"etnologo"
"etos"
"etrusco"
"euclidiano"
"euforico"
"eugenico"
"eunuco"
"europio"
"eustaquio"
"eutanasia"
"evasivo"
"eventualidade"
"evitavel"
"evoluir"
"exaustor"
"excursionista"
"exercito"
"exfoliado"
"exito"
"exotico"
"expurgo"
"exsudar"
"extrusora"
"exumar"
"fabuloso"
"facultativo"
"fado"
"fagulha"
"faixas"
"fajuto"
"faltoso"
"famoso"
"fanzine"
"fapesp"
"faquir"
"fartura"
"fastio"
"faturista"
"fausto"
"favorito"
"faxineira"
"fazer"
"fealdade"
"febril"
"fecundo"
"fedorento"
"feerico"
"feixe"
"felicidade"
"felpudo"
"feltro"
"femur"
"fenotipo"
"fervura"
"festivo"
"feto"
"feudo"
"fevereiro"
"fezinha"
"fiasco"
"fibra"
"ficticio"
"fiduciario"
"fiesp"
"fifa"
"figurino"
"fijiano"
"filtro"
"finura"
"fiorde"
"fiquei"
"firula"
"fissurar"
"fitoteca"
"fivela"
"fixo"
"flavio"
"flexor"
"flibusteiro"
"flotilha"
"fluxograma"
"fobos"
"foco"
"fofura"
"foguista"
"foie"
"foliculo"
"fominha"
"fonte"
"forum"
"fosso"
"fotossintese"
"foxtrote"
"fraudulento"
"frevo"
"frivolo"
"frouxo"
"frutose"
"fuba"
"fucsia"
"fugitivo"
"fuinha"
"fujao"
"fulustreco"
"fumo"
"funileiro"
"furunculo"
"fustigar"
"futurologo"
"fuxico"
"fuzue"
"gabriel"
"gado"
"gaelico"
"gafieira"
"gaguejo"
"gaivota"
"gajo"
"galvanoplastico"
"gamo"
"ganso"
"garrucha"
"gastronomo"
"gatuno"
"gaussiano"
"gaviao"
"gaxeta"
"gazeteiro"
"gear"
"geiser"
"geminiano"
"generoso"
"genuino"
"geossinclinal"
"gerundio"
"gestual"
"getulista"
"gibi"
"gigolo"
"gilete"
"ginseng"
"giroscopio"
"glaucio"
"glacial"
"gleba"
"glifo"
"glote"
"glutonia"
"gnostico"
"goela"
"gogo"
"goitaca"
"golpista"
"gomo"
"gonzo"
"gorro"
"gostou"
"goticula"
"gourmet"
"governo"
"gozo"
"graxo"
"grevista"
"grito"
"grotesco"
"gruta"
"guaxinim"
"gude"
"gueto"
"guizo"
"guloso"
"gume"
"guru"
"gustativo"
"grelhado"
"gutural"
"habitue"
"haitiano"
"halterofilista"
"hamburguer"
"hanseniase"
"happening"
"harpista"
"hastear"
"haveres"
"hebreu"
"hectometro"
"hedonista"
"hegira"
"helena"
"helminto"
"hemorroidas"
"henrique"
"heptassilabo"
"hertziano"
"hesitar"
"heterossexual"
"heuristico"
"hexagono"
"hiato"
"hibrido"
"hidrostatico"
"hieroglifo"
"hifenizar"
"higienizar"
"hilario"
"himen"
"hino"
"hippie"
"hirsuto"
"historiografia"
"hitlerista"
"hodometro"
"hoje"
"holograma"
"homus"
"honroso"
"hoquei"
"horto"
"hostilizar"
"hotentote"
"huguenote"
"humilde"
"huno"
"hurra"
"hutu"
"iaia"
"ialorixa"
"iambico"
"iansa"
"iaque"
"iara"
"iatista"
"iberico"
"ibis"
"icar"
"iceberg"
"icosagono"
"idade"
"ideologo"
"idiotice"
"idoso"
"iemenita"
"iene"
"igarape"
"iglu"
"ignorar"
"igreja"
"iguaria"
"iidiche"
"ilativo"
"iletrado"
"ilharga"
"ilimitado"
"ilogismo"
"ilustrissimo"
"imaturo"
"imbuzeiro"
"imerso"
"imitavel"
"imovel"
"imputar"
"imutavel"
"inaveriguavel"
"incutir"
"induzir"
"inextricavel"
"infusao"
"ingua"
"inhame"
"iniquo"
"injusto"
"inning"
"inoxidavel"
"inquisitorial"
"insustentavel"
"intumescimento"
"inutilizavel"
"invulneravel"
"inzoneiro"
"iodo"
"iogurte"
"ioio"
"ionosfera"
"ioruba"
"iota"
"ipsilon"
"irascivel"
"iris"
"irlandes"
"irmaos"
"iroques"
"irrupcao"
"isca"
"isento"
"islandes"
"isotopo"
"isqueiro"
"israelita"
"isso"
"isto"
"iterbio"
"itinerario"
"itrio"
"iuane"
"iugoslavo"
"jabuticabeira"
"jacutinga"
"jade"
"jagunco"
"jainista"
"jaleco"
"jambo"
"jantarada"
"japones"
"jaqueta"
"jarro"
"jasmim"
"jato"
"jaula"
"javel"
"jazz"
"jegue"
"jeitoso"
"jejum"
"jenipapo"
"jeova"
"jequitiba"
"jersei"
"jesus"
"jetom"
"jiboia"
"jihad"
"jilo"
"jingle"
"jipe"
"jocoso"
"joelho"
"joguete"
"joio"
"jojoba"
"jorro"
"jota"
"joule"
"joviano"
"jubiloso"
"judoca"
"jugular"
"juizo"
"jujuba"
"juliano"
"jumento"
"junto"
"jururu"
"justo"
"juta"
"juventude"
"labutar"
"laguna"
"laico"
"lajota"
"lanterninha"
"lapso"
"laquear"
"lastro"
"lauto"
"lavrar"
"laxativo"
"lazer"
"leasing"
"lebre"
"lecionar"
"ledo"
"leguminoso"
"leitura"
"lele"
"lemure"
"lento"
"leonardo"
"leopardo"
"lepton"
"leque"
"leste"
"letreiro"
"leucocito"
"levitico"
"lexicologo"
"lhama"
"lhufas"
"liame"
"licoroso"
"lidocaina"
"liliputiano"
"limusine"
"linotipo"
"lipoproteina"
"liquidos"
"lirismo"
"lisura"
"liturgico"
"livros"
"lixo"
"lobulo"
"locutor"
"lodo"
"logro"
"lojista"
"lombriga"
"lontra"
"loop"
"loquaz"
"lorota"
"losango"
"lotus"
"louvor"
"luar"
"lubrificavel"
"lucros"
"lugubre"
"luis"
"luminoso"
"luneta"
"lustroso"
"luto"
"luvas"
"luxuriante"
"luzeiro"
"maduro"
"maestro"
"mafioso"
"magro"
"maiuscula"
"majoritario"
"malvisto"
"mamute"
"manutencao"
"mapoteca"
"maquinista"
"marzipa"
"masturbar"
"matuto"
"mausoleu"
"mavioso"
"maxixe"
"mazurca"
"meandro"
"mecha"
"medusa"
"mefistofelico"
"megera"
"meirinho"
"melro"
"memorizar"
"menu"
"mequetrefe"
"mertiolate"
"mestria"
"metroviario"
"mexilhao"
"mezanino"
"miau"
"microssegundo"
"midia"
"migratorio"
"mimosa"
"minuto"
"miosotis"
"mirtilo"
"misturar"
"mitzvah"
"miudos"
"mixuruca"
"mnemonico"
"moagem"
"mobilizar"
"modulo"
"moer"
"mofo"
"mogno"
"moita"
"molusco"
"monumento"
"moqueca"
"morubixaba"
"mostruario"
"motriz"
"mouse"
"movivel"
"mozarela"
"muarra"
"muculmano"
"mudo"
"mugir"
"muitos"
"mumunha"
"munir"
"muon"
"muquira"
"murros"
"musselina"
"nacoes"
"nado"
"naftalina"
"nago"
"naipe"
"naja"
"nalgum"
"namoro"
"nanquim"
"napolitano"
"naquilo"
"nascimento"
"nautilo"
"navios"
"nazista"
"nebuloso"
"nectarina"
"nefrologo"
"negus"
"nelore"
"nenufar"
"nepotismo"
"nervura"
"neste"
"netuno"
"neutron"
"nevoeiro"
"newtoniano"
"nexo"
"nhenhenhem"
"nhoque"
"nigeriano"
"niilista"
"ninho"
"niobio"
"niponico"
"niquelar"
"nirvana"
"nisto"
"nitroglicerina"
"nivoso"
"nobreza"
"nocivo"
"noel"
"nogueira"
"noivo"
"nojo"
"nominativo"
"nonuplo"
"noruegues"
"nostalgico"
"noturno"
"nouveau"
"nuanca"
"nublar"
"nucleotideo"
"nudista"
"nulo"
"numismatico"
"nunquinha"
"nupcias"
"nutritivo"
"nuvens"
"oasis"
"obcecar"
"obeso"
"obituario"
"objetos"
"oblongo"
"obnoxio"
"obrigatorio"
"obstruir"
"obtuso"
"obus"
"obvio"
"ocaso"
"occipital"
"oceanografo"
"ocioso"
"oclusivo"
"ocorrer"
"ocre"
"octogono"
"odalisca"
"odisseia"
"odorifico"
"oersted"
"oeste"
"ofertar"
"ofidio"
"oftalmologo"
"ogiva"
"ogum"
"oigale"
"oitavo"
"oitocentos"
"ojeriza"
"olaria"
"oleoso"
"olfato"
"olhos"
"oliveira"
"olmo"
"olor"
"olvidavel"
"ombudsman"
"omeleteira"
"omitir"
"omoplata"
"onanismo"
"ondular"
"oneroso"
"onomatopeico"
"ontologico"
"onus"
"onze"
"opalescente"
"opcional"
"operistico"
"opio"
"oposto"
"oprobrio"
"optometrista"
"opusculo"
"oratorio"
"orbital"
"orcar"
"orfao"
"orixa"
"orla"
"ornitologo"
"orquidea"
"ortorrombico"
"orvalho"
"osculo"
"osmotico"
"ossudo"
"ostrogodo"
"otario"
"otite"
"ouro"
"ousar"
"outubro"
"ouvir"
"ovario"
"overnight"
"oviparo"
"ovni"
"ovoviviparo"
"ovulo"
"oxala"
"oxente"
"oxiuro"
"oxossi"
"ozonizar"
"paciente"
"pactuar"
"padronizar"
"paete"
"pagodeiro"
"paixao"
"pajem"
"paludismo"
"pampas"
"panturrilha"
"papudo"
"paquistanes"
"pastoso"
"patua"
"paulo"
"pauzinhos"
"pavoroso"
"paxa"
"pazes"
"peao"
"pecuniario"
"pedunculo"
"pegaso"
"peixinho"
"pejorativo"
"pelvis"
"penuria"
"pequno"
"petunia"
"pezada"
"piauiense"
"pictorico"
"pierro"
"pigmeu"
"pijama"
"pilulas"
"pimpolho"
"pintura"
"piorar"
"pipocar"
"piqueteiro"
"pirulito"
"pistoleiro"
"pituitaria"
"pivotar"
"pixote"
"pizzaria"
"plistoceno"
"plotar"
"pluviometrico"
"pneumonico"
"poco"
"podridao"
"poetisa"
"pogrom"
"pois"
"polvorosa"
"pomposo"
"ponderado"
"pontudo"
"populoso"
"poquer"
"porvir"
"posudo"
"potro"
"pouso"
"povoar"
"prazo"
"prezar"
"privilegios"
"proximo"
"prussiano"
"pseudopode"
"psoriase"
"pterossauros"
"ptialina"
"ptolemaico"
"pudor"
"pueril"
"pufe"
"pugilista"
"puir"
"pujante"
"pulverizar"
"pumba"
"punk"
"purulento"
"pustula"
"putsch"
"puxe"
"quatrocentos"
"quetzal"
"quixotesco"
"quotizavel"
"rabujice"
"racista"
"radonio"
"rafia"
"ragu"
"rajado"
"ralo"
"rampeiro"
"ranzinza"
"raptor"
"raquitismo"
"raro"
"rasurar"
"ratoeira"
"ravioli"
"razoavel"
"reavivar"
"rebuscar"
"recusavel"
"reduzivel"
"reexposicao"
"refutavel"
"regurgitar"
"reivindicavel"
"rejuvenescimento"
"relva"
"remuneravel"
"renunciar"
"reorientar"
"repuxo"
"requisito"
"resumo"
"returno"
"reutilizar"
"revolvido"
"rezonear"
"riacho"
"ribossomo"
"ricota"
"ridiculo"
"rifle"
"rigoroso"
"rijo"
"rimel"
"rins"
"rios"
"riqueza"
"respeito"
"rissole"
"ritualistico"
"rivalizar"
"rixa"
"robusto"
"rococo"
"rodoviario"
"roer"
"rogo"
"rojao"
"rolo"
"rompimento"
"ronronar"
"roqueiro"
"rorqual"
"rosto"
"rotundo"
"rouxinol"
"roxo"
"royal"
"ruas"
"rucula"
"rudimentos"
"ruela"
"rufo"
"rugoso"
"ruivo"
"rule"
"rumoroso"
"runico"
"ruptura"
"rural"
"rustico"
"rutilar"
"saariano"
"sabujo"
"sacudir"
"sadomasoquista"
"safra"
"sagui"
"sais"
"samurai"
"santuario"
"sapo"
"saquear"
"sartriano"
"saturno"
"saude"
"sauva"
"saveiro"
"saxofonista"
"sazonal"
"scherzo"
"script"
"seara"
"seborreia"
"secura"
"seduzir"
"sefardim"
"seguro"
"seja"
"selvas"
"sempre"
"senzala"
"sepultura"
"sequoia"
"sestercio"
"setuplo"
"seus"
"seviciar"
"sezonismo"
"shalom"
"siames"
"sibilante"
"sicrano"
"sidra"
"sifilitico"
"signos"
"silvo"
"simultaneo"
"sinusite"
"sionista"
"sirio"
"sisudo"
"situar"
"sivan"
"slide"
"slogan"
"soar"
"sobrio"
"socratico"
"sodomizar"
"soerguer"
"software"
"sogro"
"soja"
"solver"
"somente"
"sonso"
"sopro"
"soquete"
"sorveteiro"
"sossego"
"soturno"
"sousafone"
"sovinice"
"sozinho"
"suavizar"
"subverter"
"sucursal"
"sudoriparo"
"sufragio"
"sugestoes"
"suite"
"sujo"
"sultao"
"sumula"
"suntuoso"
"suor"
"supurar"
"suruba"
"susto"
"suturar"
"suvenir"
"tabuleta"
"taco"
"tadjique"
"tafeta"
"tagarelice"
"taitiano"
"talvez"
"tampouco"
"tanzaniano"
"taoista"
"tapume"
"taquion"
"tarugo"
"tascar"
"tatuar"
"tautologico"
"tavola"
"taxionomista"
"tchecoslovaco"
"teatrologo"
"tectonismo"
"tedioso"
"teflon"
"tegumento"
"teixo"
"telurio"
"temporas"
"tenue"
"teosofico"
"tepido"
"tequila"
"terrorista"
"testosterona"
"tetrico"
"teutonico"
"teve"
"texugo"
"tiara"
"tibia"
"tiete"
"tifoide"
"tigresa"
"tijolo"
"tilintar"
"timpano"
"tintureiro"
"tiquete"
"tiroteio"
"tisico"
"titulos"
"tive"
"toar"
"toboga"
"tofu"
"togoles"
"toicinho"
"tolueno"
"tomografo"
"tontura"
"toponimo"
"toquio"
"torvelinho"
"tostar"
"toto"
"touro"
"toxina"
"trazer"
"trezentos"
"trivialidade"
"trovoar"
"truta"
"tuaregue"
"tubular"
"tucano"
"tudo"
"tufo"
"tuiste"
"tulipa"
"tumultuoso"
"tunisino"
"tupiniquim"
"turvo"
"tutu"
"ucraniano"
"udenista"
"ufanista"
"ufologo"
"ugaritico"
"uiste"
"uivo"
"ulceroso"
"ulema"
"ultravioleta"
"umbilical"
"umero"
"umido"
"umlaut"
"unanimidade"
"unesco"
"ungulado"
"unheiro"
"univoco"
"untuoso"
"urano"
"urbano"
"urdir"
"uretra"
"urgente"
"urinol"
"urna"
"urologo"
"urro"
"ursulina"
"urtiga"
"urupe"
"usavel"
"usbeque"
"usei"
"usineiro"
"usurpar"
"utero"
"utilizar"
"utopico"
"uvular"
"uxoricidio"
"vacuo"
"vadio"
"vaguear"
"vaivem"
"valvula"
"vampiro"
"vantajoso"
"vaporoso"
"vaquinha"
"varziano"
"vasto"
"vaticinio"
"vaudeville"
"vazio"
"veado"
"vedico"
"veemente"
"vegetativo"
"veio"
"veja"
"veludo"
"venusiano"
"verdade"
"verve"
"vestuario"
"vetusto"
"vexatorio"
"vezes"
"viavel"
"vibratorio"
"victor"
"vicunha"
"vidros"
"vietnamita"
"vigoroso"
"vilipendiar"
"vime"
"vintem"
"violoncelo"
"viquingue"
"virus"
"visualizar"
"vituperio"
"viuvo"
"vivo"
"vizir"
"voar"
"vociferar"
"vodu"
"vogar"
"voile"
"volver"
"vomito"
"vontade"
"vortice"
"vosso"
"voto"
"vovozinha"
"voyeuse"
"vozes"
"vulva"
"vupt"
"western"
"xadrez"
"xale"
"xampu"
"xango"
"xarope"
"xaual"
"xavante"
"xaxim"
"xenonio"
"xepa"
"xerox"
"xicara"
"xifopago"
"xiita"
"xilogravura"
"xinxim"
"xistoso"
"xixi"
"xodo"
"xogum"
"xucro"
"zabumba"
"zagueiro"
"zambiano"
"zanzar"
"zarpar"
"zebu"
"zefiro"
"zeloso"
"zenite"
"zumbi"))
| 44,305 | Common Lisp | .lisp | 1,633 | 9.193509 | 60 | 0.27414 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 905a4c29f0d09a02d23372f7309f235056680d85e35871f3eaac13a1f3f282bf | 8,071 | [
-1
] |
8,072 | japanese.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/japanese.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :japanese
3
#("あいこくしん"
"あいさつ"
"あいだ"
"あおぞら"
"あかちゃん"
"あきる"
"あけがた"
"あける"
"あこがれる"
"あさい"
"あさひ"
"あしあと"
"あじわう"
"あずかる"
"あずき"
"あそぶ"
"あたえる"
"あたためる"
"あたりまえ"
"あたる"
"あつい"
"あつかう"
"あっしゅく"
"あつまり"
"あつめる"
"あてな"
"あてはまる"
"あひる"
"あぶら"
"あぶる"
"あふれる"
"あまい"
"あまど"
"あまやかす"
"あまり"
"あみもの"
"あめりか"
"あやまる"
"あゆむ"
"あらいぐま"
"あらし"
"あらすじ"
"あらためる"
"あらゆる"
"あらわす"
"ありがとう"
"あわせる"
"あわてる"
"あんい"
"あんがい"
"あんこ"
"あんぜん"
"あんてい"
"あんない"
"あんまり"
"いいだす"
"いおん"
"いがい"
"いがく"
"いきおい"
"いきなり"
"いきもの"
"いきる"
"いくじ"
"いくぶん"
"いけばな"
"いけん"
"いこう"
"いこく"
"いこつ"
"いさましい"
"いさん"
"いしき"
"いじゅう"
"いじょう"
"いじわる"
"いずみ"
"いずれ"
"いせい"
"いせえび"
"いせかい"
"いせき"
"いぜん"
"いそうろう"
"いそがしい"
"いだい"
"いだく"
"いたずら"
"いたみ"
"いたりあ"
"いちおう"
"いちじ"
"いちど"
"いちば"
"いちぶ"
"いちりゅう"
"いつか"
"いっしゅん"
"いっせい"
"いっそう"
"いったん"
"いっち"
"いってい"
"いっぽう"
"いてざ"
"いてん"
"いどう"
"いとこ"
"いない"
"いなか"
"いねむり"
"いのち"
"いのる"
"いはつ"
"いばる"
"いはん"
"いびき"
"いひん"
"いふく"
"いへん"
"いほう"
"いみん"
"いもうと"
"いもたれ"
"いもり"
"いやがる"
"いやす"
"いよかん"
"いよく"
"いらい"
"いらすと"
"いりぐち"
"いりょう"
"いれい"
"いれもの"
"いれる"
"いろえんぴつ"
"いわい"
"いわう"
"いわかん"
"いわば"
"いわゆる"
"いんげんまめ"
"いんさつ"
"いんしょう"
"いんよう"
"うえき"
"うえる"
"うおざ"
"うがい"
"うかぶ"
"うかべる"
"うきわ"
"うくらいな"
"うくれれ"
"うけたまわる"
"うけつけ"
"うけとる"
"うけもつ"
"うける"
"うごかす"
"うごく"
"うこん"
"うさぎ"
"うしなう"
"うしろがみ"
"うすい"
"うすぎ"
"うすぐらい"
"うすめる"
"うせつ"
"うちあわせ"
"うちがわ"
"うちき"
"うちゅう"
"うっかり"
"うつくしい"
"うったえる"
"うつる"
"うどん"
"うなぎ"
"うなじ"
"うなずく"
"うなる"
"うねる"
"うのう"
"うぶげ"
"うぶごえ"
"うまれる"
"うめる"
"うもう"
"うやまう"
"うよく"
"うらがえす"
"うらぐち"
"うらない"
"うりあげ"
"うりきれ"
"うるさい"
"うれしい"
"うれゆき"
"うれる"
"うろこ"
"うわき"
"うわさ"
"うんこう"
"うんちん"
"うんてん"
"うんどう"
"えいえん"
"えいが"
"えいきょう"
"えいご"
"えいせい"
"えいぶん"
"えいよう"
"えいわ"
"えおり"
"えがお"
"えがく"
"えきたい"
"えくせる"
"えしゃく"
"えすて"
"えつらん"
"えのぐ"
"えほうまき"
"えほん"
"えまき"
"えもじ"
"えもの"
"えらい"
"えらぶ"
"えりあ"
"えんえん"
"えんかい"
"えんぎ"
"えんげき"
"えんしゅう"
"えんぜつ"
"えんそく"
"えんちょう"
"えんとつ"
"おいかける"
"おいこす"
"おいしい"
"おいつく"
"おうえん"
"おうさま"
"おうじ"
"おうせつ"
"おうたい"
"おうふく"
"おうべい"
"おうよう"
"おえる"
"おおい"
"おおう"
"おおどおり"
"おおや"
"おおよそ"
"おかえり"
"おかず"
"おがむ"
"おかわり"
"おぎなう"
"おきる"
"おくさま"
"おくじょう"
"おくりがな"
"おくる"
"おくれる"
"おこす"
"おこなう"
"おこる"
"おさえる"
"おさない"
"おさめる"
"おしいれ"
"おしえる"
"おじぎ"
"おじさん"
"おしゃれ"
"おそらく"
"おそわる"
"おたがい"
"おたく"
"おだやか"
"おちつく"
"おっと"
"おつり"
"おでかけ"
"おとしもの"
"おとなしい"
"おどり"
"おどろかす"
"おばさん"
"おまいり"
"おめでとう"
"おもいで"
"おもう"
"おもたい"
"おもちゃ"
"おやつ"
"おやゆび"
"およぼす"
"おらんだ"
"おろす"
"おんがく"
"おんけい"
"おんしゃ"
"おんせん"
"おんだん"
"おんちゅう"
"おんどけい"
"かあつ"
"かいが"
"がいき"
"がいけん"
"がいこう"
"かいさつ"
"かいしゃ"
"かいすいよく"
"かいぜん"
"かいぞうど"
"かいつう"
"かいてん"
"かいとう"
"かいふく"
"がいへき"
"かいほう"
"かいよう"
"がいらい"
"かいわ"
"かえる"
"かおり"
"かかえる"
"かがく"
"かがし"
"かがみ"
"かくご"
"かくとく"
"かざる"
"がぞう"
"かたい"
"かたち"
"がちょう"
"がっきゅう"
"がっこう"
"がっさん"
"がっしょう"
"かなざわし"
"かのう"
"がはく"
"かぶか"
"かほう"
"かほご"
"かまう"
"かまぼこ"
"かめれおん"
"かゆい"
"かようび"
"からい"
"かるい"
"かろう"
"かわく"
"かわら"
"がんか"
"かんけい"
"かんこう"
"かんしゃ"
"かんそう"
"かんたん"
"かんち"
"がんばる"
"きあい"
"きあつ"
"きいろ"
"ぎいん"
"きうい"
"きうん"
"きえる"
"きおう"
"きおく"
"きおち"
"きおん"
"きかい"
"きかく"
"きかんしゃ"
"ききて"
"きくばり"
"きくらげ"
"きけんせい"
"きこう"
"きこえる"
"きこく"
"きさい"
"きさく"
"きさま"
"きさらぎ"
"ぎじかがく"
"ぎしき"
"ぎじたいけん"
"ぎじにってい"
"ぎじゅつしゃ"
"きすう"
"きせい"
"きせき"
"きせつ"
"きそう"
"きぞく"
"きぞん"
"きたえる"
"きちょう"
"きつえん"
"ぎっちり"
"きつつき"
"きつね"
"きてい"
"きどう"
"きどく"
"きない"
"きなが"
"きなこ"
"きぬごし"
"きねん"
"きのう"
"きのした"
"きはく"
"きびしい"
"きひん"
"きふく"
"きぶん"
"きぼう"
"きほん"
"きまる"
"きみつ"
"きむずかしい"
"きめる"
"きもだめし"
"きもち"
"きもの"
"きゃく"
"きやく"
"ぎゅうにく"
"きよう"
"きょうりゅう"
"きらい"
"きらく"
"きりん"
"きれい"
"きれつ"
"きろく"
"ぎろん"
"きわめる"
"ぎんいろ"
"きんかくじ"
"きんじょ"
"きんようび"
"ぐあい"
"くいず"
"くうかん"
"くうき"
"くうぐん"
"くうこう"
"ぐうせい"
"くうそう"
"ぐうたら"
"くうふく"
"くうぼ"
"くかん"
"くきょう"
"くげん"
"ぐこう"
"くさい"
"くさき"
"くさばな"
"くさる"
"くしゃみ"
"くしょう"
"くすのき"
"くすりゆび"
"くせげ"
"くせん"
"ぐたいてき"
"くださる"
"くたびれる"
"くちこみ"
"くちさき"
"くつした"
"ぐっすり"
"くつろぐ"
"くとうてん"
"くどく"
"くなん"
"くねくね"
"くのう"
"くふう"
"くみあわせ"
"くみたてる"
"くめる"
"くやくしょ"
"くらす"
"くらべる"
"くるま"
"くれる"
"くろう"
"くわしい"
"ぐんかん"
"ぐんしょく"
"ぐんたい"
"ぐんて"
"けあな"
"けいかく"
"けいけん"
"けいこ"
"けいさつ"
"げいじゅつ"
"けいたい"
"げいのうじん"
"けいれき"
"けいろ"
"けおとす"
"けおりもの"
"げきか"
"げきげん"
"げきだん"
"げきちん"
"げきとつ"
"げきは"
"げきやく"
"げこう"
"げこくじょう"
"げざい"
"けさき"
"げざん"
"けしき"
"けしごむ"
"けしょう"
"げすと"
"けたば"
"けちゃっぷ"
"けちらす"
"けつあつ"
"けつい"
"けつえき"
"けっこん"
"けつじょ"
"けっせき"
"けってい"
"けつまつ"
"げつようび"
"げつれい"
"けつろん"
"げどく"
"けとばす"
"けとる"
"けなげ"
"けなす"
"けなみ"
"けぬき"
"げねつ"
"けねん"
"けはい"
"げひん"
"けぶかい"
"げぼく"
"けまり"
"けみかる"
"けむし"
"けむり"
"けもの"
"けらい"
"けろけろ"
"けわしい"
"けんい"
"けんえつ"
"けんお"
"けんか"
"げんき"
"けんげん"
"けんこう"
"けんさく"
"けんしゅう"
"けんすう"
"げんそう"
"けんちく"
"けんてい"
"けんとう"
"けんない"
"けんにん"
"げんぶつ"
"けんま"
"けんみん"
"けんめい"
"けんらん"
"けんり"
"こあくま"
"こいぬ"
"こいびと"
"ごうい"
"こうえん"
"こうおん"
"こうかん"
"ごうきゅう"
"ごうけい"
"こうこう"
"こうさい"
"こうじ"
"こうすい"
"ごうせい"
"こうそく"
"こうたい"
"こうちゃ"
"こうつう"
"こうてい"
"こうどう"
"こうない"
"こうはい"
"ごうほう"
"ごうまん"
"こうもく"
"こうりつ"
"こえる"
"こおり"
"ごかい"
"ごがつ"
"ごかん"
"こくご"
"こくさい"
"こくとう"
"こくない"
"こくはく"
"こぐま"
"こけい"
"こける"
"ここのか"
"こころ"
"こさめ"
"こしつ"
"こすう"
"こせい"
"こせき"
"こぜん"
"こそだて"
"こたい"
"こたえる"
"こたつ"
"こちょう"
"こっか"
"こつこつ"
"こつばん"
"こつぶ"
"こてい"
"こてん"
"ことがら"
"ことし"
"ことば"
"ことり"
"こなごな"
"こねこね"
"このまま"
"このみ"
"このよ"
"ごはん"
"こひつじ"
"こふう"
"こふん"
"こぼれる"
"ごまあぶら"
"こまかい"
"ごますり"
"こまつな"
"こまる"
"こむぎこ"
"こもじ"
"こもち"
"こもの"
"こもん"
"こやく"
"こやま"
"こゆう"
"こゆび"
"こよい"
"こよう"
"こりる"
"これくしょん"
"ころっけ"
"こわもて"
"こわれる"
"こんいん"
"こんかい"
"こんき"
"こんしゅう"
"こんすい"
"こんだて"
"こんとん"
"こんなん"
"こんびに"
"こんぽん"
"こんまけ"
"こんや"
"こんれい"
"こんわく"
"ざいえき"
"さいかい"
"さいきん"
"ざいげん"
"ざいこ"
"さいしょ"
"さいせい"
"ざいたく"
"ざいちゅう"
"さいてき"
"ざいりょう"
"さうな"
"さかいし"
"さがす"
"さかな"
"さかみち"
"さがる"
"さぎょう"
"さくし"
"さくひん"
"さくら"
"さこく"
"さこつ"
"さずかる"
"ざせき"
"さたん"
"さつえい"
"ざつおん"
"ざっか"
"ざつがく"
"さっきょく"
"ざっし"
"さつじん"
"ざっそう"
"さつたば"
"さつまいも"
"さてい"
"さといも"
"さとう"
"さとおや"
"さとし"
"さとる"
"さのう"
"さばく"
"さびしい"
"さべつ"
"さほう"
"さほど"
"さます"
"さみしい"
"さみだれ"
"さむけ"
"さめる"
"さやえんどう"
"さゆう"
"さよう"
"さよく"
"さらだ"
"ざるそば"
"さわやか"
"さわる"
"さんいん"
"さんか"
"さんきゃく"
"さんこう"
"さんさい"
"ざんしょ"
"さんすう"
"さんせい"
"さんそ"
"さんち"
"さんま"
"さんみ"
"さんらん"
"しあい"
"しあげ"
"しあさって"
"しあわせ"
"しいく"
"しいん"
"しうち"
"しえい"
"しおけ"
"しかい"
"しかく"
"じかん"
"しごと"
"しすう"
"じだい"
"したうけ"
"したぎ"
"したて"
"したみ"
"しちょう"
"しちりん"
"しっかり"
"しつじ"
"しつもん"
"してい"
"してき"
"してつ"
"じてん"
"じどう"
"しなぎれ"
"しなもの"
"しなん"
"しねま"
"しねん"
"しのぐ"
"しのぶ"
"しはい"
"しばかり"
"しはつ"
"しはらい"
"しはん"
"しひょう"
"しふく"
"じぶん"
"しへい"
"しほう"
"しほん"
"しまう"
"しまる"
"しみん"
"しむける"
"じむしょ"
"しめい"
"しめる"
"しもん"
"しゃいん"
"しゃうん"
"しゃおん"
"じゃがいも"
"しやくしょ"
"しゃくほう"
"しゃけん"
"しゃこ"
"しゃざい"
"しゃしん"
"しゃせん"
"しゃそう"
"しゃたい"
"しゃちょう"
"しゃっきん"
"じゃま"
"しゃりん"
"しゃれい"
"じゆう"
"じゅうしょ"
"しゅくはく"
"じゅしん"
"しゅっせき"
"しゅみ"
"しゅらば"
"じゅんばん"
"しょうかい"
"しょくたく"
"しょっけん"
"しょどう"
"しょもつ"
"しらせる"
"しらべる"
"しんか"
"しんこう"
"じんじゃ"
"しんせいじ"
"しんちく"
"しんりん"
"すあげ"
"すあし"
"すあな"
"ずあん"
"すいえい"
"すいか"
"すいとう"
"ずいぶん"
"すいようび"
"すうがく"
"すうじつ"
"すうせん"
"すおどり"
"すきま"
"すくう"
"すくない"
"すける"
"すごい"
"すこし"
"ずさん"
"すずしい"
"すすむ"
"すすめる"
"すっかり"
"ずっしり"
"ずっと"
"すてき"
"すてる"
"すねる"
"すのこ"
"すはだ"
"すばらしい"
"ずひょう"
"ずぶぬれ"
"すぶり"
"すふれ"
"すべて"
"すべる"
"ずほう"
"すぼん"
"すまい"
"すめし"
"すもう"
"すやき"
"すらすら"
"するめ"
"すれちがう"
"すろっと"
"すわる"
"すんぜん"
"すんぽう"
"せあぶら"
"せいかつ"
"せいげん"
"せいじ"
"せいよう"
"せおう"
"せかいかん"
"せきにん"
"せきむ"
"せきゆ"
"せきらんうん"
"せけん"
"せこう"
"せすじ"
"せたい"
"せたけ"
"せっかく"
"せっきゃく"
"ぜっく"
"せっけん"
"せっこつ"
"せっさたくま"
"せつぞく"
"せつだん"
"せつでん"
"せっぱん"
"せつび"
"せつぶん"
"せつめい"
"せつりつ"
"せなか"
"せのび"
"せはば"
"せびろ"
"せぼね"
"せまい"
"せまる"
"せめる"
"せもたれ"
"せりふ"
"ぜんあく"
"せんい"
"せんえい"
"せんか"
"せんきょ"
"せんく"
"せんげん"
"ぜんご"
"せんさい"
"せんしゅ"
"せんすい"
"せんせい"
"せんぞ"
"せんたく"
"せんちょう"
"せんてい"
"せんとう"
"せんぬき"
"せんねん"
"せんぱい"
"ぜんぶ"
"ぜんぽう"
"せんむ"
"せんめんじょ"
"せんもん"
"せんやく"
"せんゆう"
"せんよう"
"ぜんら"
"ぜんりゃく"
"せんれい"
"せんろ"
"そあく"
"そいとげる"
"そいね"
"そうがんきょう"
"そうき"
"そうご"
"そうしん"
"そうだん"
"そうなん"
"そうび"
"そうめん"
"そうり"
"そえもの"
"そえん"
"そがい"
"そげき"
"そこう"
"そこそこ"
"そざい"
"そしな"
"そせい"
"そせん"
"そそぐ"
"そだてる"
"そつう"
"そつえん"
"そっかん"
"そつぎょう"
"そっけつ"
"そっこう"
"そっせん"
"そっと"
"そとがわ"
"そとづら"
"そなえる"
"そなた"
"そふぼ"
"そぼく"
"そぼろ"
"そまつ"
"そまる"
"そむく"
"そむりえ"
"そめる"
"そもそも"
"そよかぜ"
"そらまめ"
"そろう"
"そんかい"
"そんけい"
"そんざい"
"そんしつ"
"そんぞく"
"そんちょう"
"ぞんび"
"ぞんぶん"
"そんみん"
"たあい"
"たいいん"
"たいうん"
"たいえき"
"たいおう"
"だいがく"
"たいき"
"たいぐう"
"たいけん"
"たいこ"
"たいざい"
"だいじょうぶ"
"だいすき"
"たいせつ"
"たいそう"
"だいたい"
"たいちょう"
"たいてい"
"だいどころ"
"たいない"
"たいねつ"
"たいのう"
"たいはん"
"だいひょう"
"たいふう"
"たいへん"
"たいほ"
"たいまつばな"
"たいみんぐ"
"たいむ"
"たいめん"
"たいやき"
"たいよう"
"たいら"
"たいりょく"
"たいる"
"たいわん"
"たうえ"
"たえる"
"たおす"
"たおる"
"たおれる"
"たかい"
"たかね"
"たきび"
"たくさん"
"たこく"
"たこやき"
"たさい"
"たしざん"
"だじゃれ"
"たすける"
"たずさわる"
"たそがれ"
"たたかう"
"たたく"
"ただしい"
"たたみ"
"たちばな"
"だっかい"
"だっきゃく"
"だっこ"
"だっしゅつ"
"だったい"
"たてる"
"たとえる"
"たなばた"
"たにん"
"たぬき"
"たのしみ"
"たはつ"
"たぶん"
"たべる"
"たぼう"
"たまご"
"たまる"
"だむる"
"ためいき"
"ためす"
"ためる"
"たもつ"
"たやすい"
"たよる"
"たらす"
"たりきほんがん"
"たりょう"
"たりる"
"たると"
"たれる"
"たれんと"
"たろっと"
"たわむれる"
"だんあつ"
"たんい"
"たんおん"
"たんか"
"たんき"
"たんけん"
"たんご"
"たんさん"
"たんじょうび"
"だんせい"
"たんそく"
"たんたい"
"だんち"
"たんてい"
"たんとう"
"だんな"
"たんにん"
"だんねつ"
"たんのう"
"たんぴん"
"だんぼう"
"たんまつ"
"たんめい"
"だんれつ"
"だんろ"
"だんわ"
"ちあい"
"ちあん"
"ちいき"
"ちいさい"
"ちえん"
"ちかい"
"ちから"
"ちきゅう"
"ちきん"
"ちけいず"
"ちけん"
"ちこく"
"ちさい"
"ちしき"
"ちしりょう"
"ちせい"
"ちそう"
"ちたい"
"ちたん"
"ちちおや"
"ちつじょ"
"ちてき"
"ちてん"
"ちぬき"
"ちぬり"
"ちのう"
"ちひょう"
"ちへいせん"
"ちほう"
"ちまた"
"ちみつ"
"ちみどろ"
"ちめいど"
"ちゃんこなべ"
"ちゅうい"
"ちゆりょく"
"ちょうし"
"ちょさくけん"
"ちらし"
"ちらみ"
"ちりがみ"
"ちりょう"
"ちるど"
"ちわわ"
"ちんたい"
"ちんもく"
"ついか"
"ついたち"
"つうか"
"つうじょう"
"つうはん"
"つうわ"
"つかう"
"つかれる"
"つくね"
"つくる"
"つけね"
"つける"
"つごう"
"つたえる"
"つづく"
"つつじ"
"つつむ"
"つとめる"
"つながる"
"つなみ"
"つねづね"
"つのる"
"つぶす"
"つまらない"
"つまる"
"つみき"
"つめたい"
"つもり"
"つもる"
"つよい"
"つるぼ"
"つるみく"
"つわもの"
"つわり"
"てあし"
"てあて"
"てあみ"
"ていおん"
"ていか"
"ていき"
"ていけい"
"ていこく"
"ていさつ"
"ていし"
"ていせい"
"ていたい"
"ていど"
"ていねい"
"ていひょう"
"ていへん"
"ていぼう"
"てうち"
"ておくれ"
"てきとう"
"てくび"
"でこぼこ"
"てさぎょう"
"てさげ"
"てすり"
"てそう"
"てちがい"
"てちょう"
"てつがく"
"てつづき"
"でっぱ"
"てつぼう"
"てつや"
"でぬかえ"
"てぬき"
"てぬぐい"
"てのひら"
"てはい"
"てぶくろ"
"てふだ"
"てほどき"
"てほん"
"てまえ"
"てまきずし"
"てみじか"
"てみやげ"
"てらす"
"てれび"
"てわけ"
"てわたし"
"でんあつ"
"てんいん"
"てんかい"
"てんき"
"てんぐ"
"てんけん"
"てんごく"
"てんさい"
"てんし"
"てんすう"
"でんち"
"てんてき"
"てんとう"
"てんない"
"てんぷら"
"てんぼうだい"
"てんめつ"
"てんらんかい"
"でんりょく"
"でんわ"
"どあい"
"といれ"
"どうかん"
"とうきゅう"
"どうぐ"
"とうし"
"とうむぎ"
"とおい"
"とおか"
"とおく"
"とおす"
"とおる"
"とかい"
"とかす"
"ときおり"
"ときどき"
"とくい"
"とくしゅう"
"とくてん"
"とくに"
"とくべつ"
"とけい"
"とける"
"とこや"
"とさか"
"としょかん"
"とそう"
"とたん"
"とちゅう"
"とっきゅう"
"とっくん"
"とつぜん"
"とつにゅう"
"とどける"
"ととのえる"
"とない"
"となえる"
"となり"
"とのさま"
"とばす"
"どぶがわ"
"とほう"
"とまる"
"とめる"
"ともだち"
"ともる"
"どようび"
"とらえる"
"とんかつ"
"どんぶり"
"ないかく"
"ないこう"
"ないしょ"
"ないす"
"ないせん"
"ないそう"
"なおす"
"ながい"
"なくす"
"なげる"
"なこうど"
"なさけ"
"なたでここ"
"なっとう"
"なつやすみ"
"ななおし"
"なにごと"
"なにもの"
"なにわ"
"なのか"
"なふだ"
"なまいき"
"なまえ"
"なまみ"
"なみだ"
"なめらか"
"なめる"
"なやむ"
"ならう"
"ならび"
"ならぶ"
"なれる"
"なわとび"
"なわばり"
"にあう"
"にいがた"
"にうけ"
"におい"
"にかい"
"にがて"
"にきび"
"にくしみ"
"にくまん"
"にげる"
"にさんかたんそ"
"にしき"
"にせもの"
"にちじょう"
"にちようび"
"にっか"
"にっき"
"にっけい"
"にっこう"
"にっさん"
"にっしょく"
"にっすう"
"にっせき"
"にってい"
"になう"
"にほん"
"にまめ"
"にもつ"
"にやり"
"にゅういん"
"にりんしゃ"
"にわとり"
"にんい"
"にんか"
"にんき"
"にんげん"
"にんしき"
"にんずう"
"にんそう"
"にんたい"
"にんち"
"にんてい"
"にんにく"
"にんぷ"
"にんまり"
"にんむ"
"にんめい"
"にんよう"
"ぬいくぎ"
"ぬかす"
"ぬぐいとる"
"ぬぐう"
"ぬくもり"
"ぬすむ"
"ぬまえび"
"ぬめり"
"ぬらす"
"ぬんちゃく"
"ねあげ"
"ねいき"
"ねいる"
"ねいろ"
"ねぐせ"
"ねくたい"
"ねくら"
"ねこぜ"
"ねこむ"
"ねさげ"
"ねすごす"
"ねそべる"
"ねだん"
"ねつい"
"ねっしん"
"ねつぞう"
"ねったいぎょ"
"ねぶそく"
"ねふだ"
"ねぼう"
"ねほりはほり"
"ねまき"
"ねまわし"
"ねみみ"
"ねむい"
"ねむたい"
"ねもと"
"ねらう"
"ねわざ"
"ねんいり"
"ねんおし"
"ねんかん"
"ねんきん"
"ねんぐ"
"ねんざ"
"ねんし"
"ねんちゃく"
"ねんど"
"ねんぴ"
"ねんぶつ"
"ねんまつ"
"ねんりょう"
"ねんれい"
"のいず"
"のおづま"
"のがす"
"のきなみ"
"のこぎり"
"のこす"
"のこる"
"のせる"
"のぞく"
"のぞむ"
"のたまう"
"のちほど"
"のっく"
"のばす"
"のはら"
"のべる"
"のぼる"
"のみもの"
"のやま"
"のらいぬ"
"のらねこ"
"のりもの"
"のりゆき"
"のれん"
"のんき"
"ばあい"
"はあく"
"ばあさん"
"ばいか"
"ばいく"
"はいけん"
"はいご"
"はいしん"
"はいすい"
"はいせん"
"はいそう"
"はいち"
"ばいばい"
"はいれつ"
"はえる"
"はおる"
"はかい"
"ばかり"
"はかる"
"はくしゅ"
"はけん"
"はこぶ"
"はさみ"
"はさん"
"はしご"
"ばしょ"
"はしる"
"はせる"
"ぱそこん"
"はそん"
"はたん"
"はちみつ"
"はつおん"
"はっかく"
"はづき"
"はっきり"
"はっくつ"
"はっけん"
"はっこう"
"はっさん"
"はっしん"
"はったつ"
"はっちゅう"
"はってん"
"はっぴょう"
"はっぽう"
"はなす"
"はなび"
"はにかむ"
"はぶらし"
"はみがき"
"はむかう"
"はめつ"
"はやい"
"はやし"
"はらう"
"はろうぃん"
"はわい"
"はんい"
"はんえい"
"はんおん"
"はんかく"
"はんきょう"
"ばんぐみ"
"はんこ"
"はんしゃ"
"はんすう"
"はんだん"
"ぱんち"
"ぱんつ"
"はんてい"
"はんとし"
"はんのう"
"はんぱ"
"はんぶん"
"はんぺん"
"はんぼうき"
"はんめい"
"はんらん"
"はんろん"
"ひいき"
"ひうん"
"ひえる"
"ひかく"
"ひかり"
"ひかる"
"ひかん"
"ひくい"
"ひけつ"
"ひこうき"
"ひこく"
"ひさい"
"ひさしぶり"
"ひさん"
"びじゅつかん"
"ひしょ"))
| 50,592 | Common Lisp | .lisp | 1,633 | 5.775873 | 60 | 0.16491 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 0fe4b2201d8aa88b8cf330f5bd50ab7b512dc6c0486cff2a7ab730fc19a8fc5e | 8,072 | [
-1
] |
8,073 | german.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/german.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :german
4
#("Abakus"
"Abart"
"abbilden"
"Abbruch"
"Abdrift"
"Abendrot"
"Abfahrt"
"abfeuern"
"Abflug"
"abfragen"
"Abglanz"
"abhärten"
"abheben"
"Abhilfe"
"Abitur"
"Abkehr"
"Ablauf"
"ablecken"
"Ablösung"
"Abnehmer"
"abnutzen"
"Abonnent"
"Abrasion"
"Abrede"
"abrüsten"
"Absicht"
"Absprung"
"Abstand"
"absuchen"
"Abteil"
"Abundanz"
"abwarten"
"Abwurf"
"Abzug"
"Achse"
"Achtung"
"Acker"
"Aderlass"
"Adler"
"Admiral"
"Adresse"
"Affe"
"Affront"
"Afrika"
"Aggregat"
"Agilität"
"ähneln"
"Ahnung"
"Ahorn"
"Akazie"
"Akkord"
"Akrobat"
"Aktfoto"
"Aktivist"
"Albatros"
"Alchimie"
"Alemanne"
"Alibi"
"Alkohol"
"Allee"
"Allüre"
"Almosen"
"Almweide"
"Aloe"
"Alpaka"
"Alpental"
"Alphabet"
"Alpinist"
"Alraune"
"Altbier"
"Alter"
"Altflöte"
"Altruist"
"Alublech"
"Aludose"
"Amateur"
"Amazonas"
"Ameise"
"Amnesie"
"Amok"
"Ampel"
"Amphibie"
"Ampulle"
"Amsel"
"Amulett"
"Anakonda"
"Analogie"
"Ananas"
"Anarchie"
"Anatomie"
"Anbau"
"Anbeginn"
"anbieten"
"Anblick"
"ändern"
"andocken"
"Andrang"
"anecken"
"Anflug"
"Anfrage"
"Anführer"
"Angebot"
"Angler"
"Anhalter"
"Anhöhe"
"Animator"
"Anis"
"Anker"
"ankleben"
"Ankunft"
"Anlage"
"anlocken"
"Anmut"
"Annahme"
"Anomalie"
"Anonymus"
"Anorak"
"anpeilen"
"Anrecht"
"Anruf"
"Ansage"
"Anschein"
"Ansicht"
"Ansporn"
"Anteil"
"Antlitz"
"Antrag"
"Antwort"
"Anwohner"
"Aorta"
"Apfel"
"Appetit"
"Applaus"
"Aquarium"
"Arbeit"
"Arche"
"Argument"
"Arktis"
"Armband"
"Aroma"
"Asche"
"Askese"
"Asphalt"
"Asteroid"
"Ästhetik"
"Astronom"
"Atelier"
"Athlet"
"Atlantik"
"Atmung"
"Audienz"
"aufatmen"
"Auffahrt"
"aufholen"
"aufregen"
"Aufsatz"
"Auftritt"
"Aufwand"
"Augapfel"
"Auktion"
"Ausbruch"
"Ausflug"
"Ausgabe"
"Aushilfe"
"Ausland"
"Ausnahme"
"Aussage"
"Autobahn"
"Avocado"
"Axthieb"
"Bach"
"backen"
"Badesee"
"Bahnhof"
"Balance"
"Balkon"
"Ballett"
"Balsam"
"Banane"
"Bandage"
"Bankett"
"Barbar"
"Barde"
"Barett"
"Bargeld"
"Barkasse"
"Barriere"
"Bart"
"Bass"
"Bastler"
"Batterie"
"Bauch"
"Bauer"
"Bauholz"
"Baujahr"
"Baum"
"Baustahl"
"Bauteil"
"Bauweise"
"Bazar"
"beachten"
"Beatmung"
"beben"
"Becher"
"Becken"
"bedanken"
"beeilen"
"beenden"
"Beere"
"befinden"
"Befreier"
"Begabung"
"Begierde"
"begrüßen"
"Beiboot"
"Beichte"
"Beifall"
"Beigabe"
"Beil"
"Beispiel"
"Beitrag"
"beizen"
"bekommen"
"beladen"
"Beleg"
"bellen"
"belohnen"
"Bemalung"
"Bengel"
"Benutzer"
"Benzin"
"beraten"
"Bereich"
"Bergluft"
"Bericht"
"Bescheid"
"Besitz"
"besorgen"
"Bestand"
"Besuch"
"betanken"
"beten"
"betören"
"Bett"
"Beule"
"Beute"
"Bewegung"
"bewirken"
"Bewohner"
"bezahlen"
"Bezug"
"biegen"
"Biene"
"Bierzelt"
"bieten"
"Bikini"
"Bildung"
"Billard"
"binden"
"Biobauer"
"Biologe"
"Bionik"
"Biotop"
"Birke"
"Bison"
"Bitte"
"Biwak"
"Bizeps"
"blasen"
"Blatt"
"Blauwal"
"Blende"
"Blick"
"Blitz"
"Blockade"
"Blödelei"
"Blondine"
"Blues"
"Blume"
"Blut"
"Bodensee"
"Bogen"
"Boje"
"Bollwerk"
"Bonbon"
"Bonus"
"Boot"
"Bordarzt"
"Börse"
"Böschung"
"Boudoir"
"Boxkampf"
"Boykott"
"Brahms"
"Brandung"
"Brauerei"
"Brecher"
"Breitaxt"
"Bremse"
"brennen"
"Brett"
"Brief"
"Brigade"
"Brillanz"
"bringen"
"brodeln"
"Brosche"
"Brötchen"
"Brücke"
"Brunnen"
"Brüste"
"Brutofen"
"Buch"
"Büffel"
"Bugwelle"
"Bühne"
"Buletten"
"Bullauge"
"Bumerang"
"bummeln"
"Buntglas"
"Bürde"
"Burgherr"
"Bursche"
"Busen"
"Buslinie"
"Bussard"
"Butangas"
"Butter"
"Cabrio"
"campen"
"Captain"
"Cartoon"
"Cello"
"Chalet"
"Charisma"
"Chefarzt"
"Chiffon"
"Chipsatz"
"Chirurg"
"Chor"
"Chronik"
"Chuzpe"
"Clubhaus"
"Cockpit"
"Codewort"
"Cognac"
"Coladose"
"Computer"
"Coupon"
"Cousin"
"Cracking"
"Crash"
"Curry"
"Dach"
"Dackel"
"daddeln"
"daliegen"
"Dame"
"Dammbau"
"Dämon"
"Dampflok"
"Dank"
"Darm"
"Datei"
"Datsche"
"Datteln"
"Datum"
"Dauer"
"Daunen"
"Deckel"
"Decoder"
"Defekt"
"Degen"
"Dehnung"
"Deiche"
"Dekade"
"Dekor"
"Delfin"
"Demut"
"denken"
"Deponie"
"Design"
"Desktop"
"Dessert"
"Detail"
"Detektiv"
"Dezibel"
"Diadem"
"Diagnose"
"Dialekt"
"Diamant"
"Dichter"
"Dickicht"
"Diesel"
"Diktat"
"Diplom"
"Direktor"
"Dirne"
"Diskurs"
"Distanz"
"Docht"
"Dohle"
"Dolch"
"Domäne"
"Donner"
"Dorade"
"Dorf"
"Dörrobst"
"Dorsch"
"Dossier"
"Dozent"
"Drachen"
"Draht"
"Drama"
"Drang"
"Drehbuch"
"Dreieck"
"Dressur"
"Drittel"
"Drossel"
"Druck"
"Duell"
"Duft"
"Düne"
"Dünung"
"dürfen"
"Duschbad"
"Düsenjet"
"Dynamik"
"Ebbe"
"Echolot"
"Echse"
"Eckball"
"Edding"
"Edelweiß"
"Eden"
"Edition"
"Efeu"
"Effekte"
"Egoismus"
"Ehre"
"Eiablage"
"Eiche"
"Eidechse"
"Eidotter"
"Eierkopf"
"Eigelb"
"Eiland"
"Eilbote"
"Eimer"
"einatmen"
"Einband"
"Eindruck"
"Einfall"
"Eingang"
"Einkauf"
"einladen"
"Einöde"
"Einrad"
"Eintopf"
"Einwurf"
"Einzug"
"Eisbär"
"Eisen"
"Eishöhle"
"Eismeer"
"Eiweiß"
"Ekstase"
"Elan"
"Elch"
"Elefant"
"Eleganz"
"Element"
"Elfe"
"Elite"
"Elixier"
"Ellbogen"
"Eloquenz"
"Emigrant"
"Emission"
"Emotion"
"Empathie"
"Empfang"
"Endzeit"
"Energie"
"Engpass"
"Enkel"
"Enklave"
"Ente"
"entheben"
"Entität"
"entladen"
"Entwurf"
"Episode"
"Epoche"
"erachten"
"Erbauer"
"erblühen"
"Erdbeere"
"Erde"
"Erdgas"
"Erdkunde"
"Erdnuss"
"Erdöl"
"Erdteil"
"Ereignis"
"Eremit"
"erfahren"
"Erfolg"
"erfreuen"
"erfüllen"
"Ergebnis"
"erhitzen"
"erkalten"
"erkennen"
"erleben"
"Erlösung"
"ernähren"
"erneuern"
"Ernte"
"Eroberer"
"eröffnen"
"Erosion"
"Erotik"
"Erpel"
"erraten"
"Erreger"
"erröten"
"Ersatz"
"Erstflug"
"Ertrag"
"Eruption"
"erwarten"
"erwidern"
"Erzbau"
"Erzeuger"
"erziehen"
"Esel"
"Eskimo"
"Eskorte"
"Espe"
"Espresso"
"essen"
"Etage"
"Etappe"
"Etat"
"Ethik"
"Etikett"
"Etüde"
"Eule"
"Euphorie"
"Europa"
"Everest"
"Examen"
"Exil"
"Exodus"
"Extrakt"
"Fabel"
"Fabrik"
"Fachmann"
"Fackel"
"Faden"
"Fagott"
"Fahne"
"Faible"
"Fairness"
"Fakt"
"Fakultät"
"Falke"
"Fallobst"
"Fälscher"
"Faltboot"
"Familie"
"Fanclub"
"Fanfare"
"Fangarm"
"Fantasie"
"Farbe"
"Farmhaus"
"Farn"
"Fasan"
"Faser"
"Fassung"
"fasten"
"Faulheit"
"Fauna"
"Faust"
"Favorit"
"Faxgerät"
"Fazit"
"fechten"
"Federboa"
"Fehler"
"Feier"
"Feige"
"feilen"
"Feinripp"
"Feldbett"
"Felge"
"Fellpony"
"Felswand"
"Ferien"
"Ferkel"
"Fernweh"
"Ferse"
"Fest"
"Fettnapf"
"Feuer"
"Fiasko"
"Fichte"
"Fiktion"
"Film"
"Filter"
"Filz"
"Finanzen"
"Findling"
"Finger"
"Fink"
"Finnwal"
"Fisch"
"Fitness"
"Fixpunkt"
"Fixstern"
"Fjord"
"Flachbau"
"Flagge"
"Flamenco"
"Flanke"
"Flasche"
"Flaute"
"Fleck"
"Flegel"
"flehen"
"Fleisch"
"fliegen"
"Flinte"
"Flirt"
"Flocke"
"Floh"
"Floskel"
"Floß"
"Flöte"
"Flugzeug"
"Flunder"
"Flusstal"
"Flutung"
"Fockmast"
"Fohlen"
"Föhnlage"
"Fokus"
"folgen"
"Foliant"
"Folklore"
"Fontäne"
"Förde"
"Forelle"
"Format"
"Forscher"
"Fortgang"
"Forum"
"Fotograf"
"Frachter"
"Fragment"
"Fraktion"
"fräsen"
"Frauenpo"
"Freak"
"Fregatte"
"Freiheit"
"Freude"
"Frieden"
"Frohsinn"
"Frosch"
"Frucht"
"Frühjahr"
"Fuchs"
"Fügung"
"fühlen"
"Füller"
"Fundbüro"
"Funkboje"
"Funzel"
"Furnier"
"Fürsorge"
"Fusel"
"Fußbad"
"Futteral"
"Gabelung"
"gackern"
"Gage"
"gähnen"
"Galaxie"
"Galeere"
"Galopp"
"Gameboy"
"Gamsbart"
"Gandhi"
"Gang"
"Garage"
"Gardine"
"Garküche"
"Garten"
"Gasthaus"
"Gattung"
"gaukeln"
"Gazelle"
"Gebäck"
"Gebirge"
"Gebräu"
"Geburt"
"Gedanke"
"Gedeck"
"Gedicht"
"Gefahr"
"Gefieder"
"Geflügel"
"Gefühl"
"Gegend"
"Gehirn"
"Gehöft"
"Gehweg"
"Geige"
"Geist"
"Gelage"
"Geld"
"Gelenk"
"Gelübde"
"Gemälde"
"Gemeinde"
"Gemüse"
"genesen"
"Genuss"
"Gepäck"
"Geranie"
"Gericht"
"Germane"
"Geruch"
"Gesang"
"Geschenk"
"Gesetz"
"Gesindel"
"Gesöff"
"Gespan"
"Gestade"
"Gesuch"
"Getier"
"Getränk"
"Getümmel"
"Gewand"
"Geweih"
"Gewitter"
"Gewölbe"
"Geysir"
"Giftzahn"
"Gipfel"
"Giraffe"
"Gitarre"
"glänzen"
"Glasauge"
"Glatze"
"Gleis"
"Globus"
"Glück"
"glühen"
"Glutofen"
"Goldzahn"
"Gondel"
"gönnen"
"Gottheit"
"graben"
"Grafik"
"Grashalm"
"Graugans"
"greifen"
"Grenze"
"grillen"
"Groschen"
"Grotte"
"Grube"
"Grünalge"
"Gruppe"
"gruseln"
"Gulasch"
"Gummibär"
"Gurgel"
"Gürtel"
"Güterzug"
"Haarband"
"Habicht"
"hacken"
"hadern"
"Hafen"
"Hagel"
"Hähnchen"
"Haifisch"
"Haken"
"Halbaffe"
"Halsader"
"halten"
"Halunke"
"Handbuch"
"Hanf"
"Harfe"
"Harnisch"
"härten"
"Harz"
"Hasenohr"
"Haube"
"hauchen"
"Haupt"
"Haut"
"Havarie"
"Hebamme"
"hecheln"
"Heck"
"Hedonist"
"Heiler"
"Heimat"
"Heizung"
"Hektik"
"Held"
"helfen"
"Helium"
"Hemd"
"hemmen"
"Hengst"
"Herd"
"Hering"
"Herkunft"
"Hermelin"
"Herrchen"
"Herzdame"
"Heulboje"
"Hexe"
"Hilfe"
"Himbeere"
"Himmel"
"Hingabe"
"hinhören"
"Hinweis"
"Hirsch"
"Hirte"
"Hitzkopf"
"Hobel"
"Hochform"
"Hocker"
"hoffen"
"Hofhund"
"Hofnarr"
"Höhenzug"
"Hohlraum"
"Hölle"
"Holzboot"
"Honig"
"Honorar"
"horchen"
"Hörprobe"
"Höschen"
"Hotel"
"Hubraum"
"Hufeisen"
"Hügel"
"huldigen"
"Hülle"
"Humbug"
"Hummer"
"Humor"
"Hund"
"Hunger"
"Hupe"
"Hürde"
"Hurrikan"
"Hydrant"
"Hypnose"
"Ibis"
"Idee"
"Idiot"
"Igel"
"Illusion"
"Imitat"
"impfen"
"Import"
"Inferno"
"Ingwer"
"Inhalte"
"Inland"
"Insekt"
"Ironie"
"Irrfahrt"
"Irrtum"
"Isolator"
"Istwert"
"Jacke"
"Jade"
"Jagdhund"
"Jäger"
"Jaguar"
"Jahr"
"Jähzorn"
"Jazzfest"
"Jetpilot"
"jobben"
"Jochbein"
"jodeln"
"Jodsalz"
"Jolle"
"Journal"
"Jubel"
"Junge"
"Junimond"
"Jupiter"
"Jutesack"
"Juwel"
"Kabarett"
"Kabine"
"Kabuff"
"Käfer"
"Kaffee"
"Kahlkopf"
"Kaimauer"
"Kajüte"
"Kaktus"
"Kaliber"
"Kaltluft"
"Kamel"
"kämmen"
"Kampagne"
"Kanal"
"Känguru"
"Kanister"
"Kanone"
"Kante"
"Kanu"
"kapern"
"Kapitän"
"Kapuze"
"Karneval"
"Karotte"
"Käsebrot"
"Kasper"
"Kastanie"
"Katalog"
"Kathode"
"Katze"
"kaufen"
"Kaugummi"
"Kauz"
"Kehle"
"Keilerei"
"Keksdose"
"Kellner"
"Keramik"
"Kerze"
"Kessel"
"Kette"
"keuchen"
"kichern"
"Kielboot"
"Kindheit"
"Kinnbart"
"Kinosaal"
"Kiosk"
"Kissen"
"Klammer"
"Klang"
"Klapprad"
"Klartext"
"kleben"
"Klee"
"Kleinod"
"Klima"
"Klingel"
"Klippe"
"Klischee"
"Kloster"
"Klugheit"
"Klüngel"
"kneten"
"Knie"
"Knöchel"
"knüpfen"
"Kobold"
"Kochbuch"
"Kohlrabi"
"Koje"
"Kokosöl"
"Kolibri"
"Kolumne"
"Kombüse"
"Komiker"
"kommen"
"Konto"
"Konzept"
"Kopfkino"
"Kordhose"
"Korken"
"Korsett"
"Kosename"
"Krabbe"
"Krach"
"Kraft"
"Krähe"
"Kralle"
"Krapfen"
"Krater"
"kraulen"
"Kreuz"
"Krokodil"
"Kröte"
"Kugel"
"Kuhhirt"
"Kühnheit"
"Künstler"
"Kurort"
"Kurve"
"Kurzfilm"
"kuscheln"
"küssen"
"Kutter"
"Labor"
"lachen"
"Lackaffe"
"Ladeluke"
"Lagune"
"Laib"
"Lakritze"
"Lammfell"
"Land"
"Langmut"
"Lappalie"
"Last"
"Laterne"
"Latzhose"
"Laubsäge"
"laufen"
"Laune"
"Lausbub"
"Lavasee"
"Leben"
"Leder"
"Leerlauf"
"Lehm"
"Lehrer"
"leihen"
"Lektüre"
"Lenker"
"Lerche"
"Leseecke"
"Leuchter"
"Lexikon"
"Libelle"
"Libido"
"Licht"
"Liebe"
"liefern"
"Liftboy"
"Limonade"
"Lineal"
"Linoleum"
"List"
"Liveband"
"Lobrede"
"locken"
"Löffel"
"Logbuch"
"Logik"
"Lohn"
"Loipe"
"Lokal"
"Lorbeer"
"Lösung"
"löten"
"Lottofee"
"Löwe"
"Luchs"
"Luder"
"Luftpost"
"Luke"
"Lümmel"
"Lunge"
"lutschen"
"Luxus"
"Macht"
"Magazin"
"Magier"
"Magnet"
"mähen"
"Mahlzeit"
"Mahnmal"
"Maibaum"
"Maisbrei"
"Makel"
"malen"
"Mammut"
"Maniküre"
"Mantel"
"Marathon"
"Marder"
"Marine"
"Marke"
"Marmor"
"Märzluft"
"Maske"
"Maßanzug"
"Maßkrug"
"Mastkorb"
"Material"
"Matratze"
"Mauerbau"
"Maulkorb"
"Mäuschen"
"Mäzen"
"Medium"
"Meinung"
"melden"
"Melodie"
"Mensch"
"Merkmal"
"Messe"
"Metall"
"Meteor"
"Methode"
"Metzger"
"Mieze"
"Milchkuh"
"Mimose"
"Minirock"
"Minute"
"mischen"
"Missetat"
"mitgehen"
"Mittag"
"Mixtape"
"Möbel"
"Modul"
"mögen"
"Möhre"
"Molch"
"Moment"
"Monat"
"Mondflug"
"Monitor"
"Monokini"
"Monster"
"Monument"
"Moorhuhn"
"Moos"
"Möpse"
"Moral"
"Mörtel"
"Motiv"
"Motorrad"
"Möwe"
"Mühe"
"Mulatte"
"Müller"
"Mumie"
"Mund"
"Münze"
"Muschel"
"Muster"
"Mythos"
"Nabel"
"Nachtzug"
"Nackedei"
"Nagel"
"Nähe"
"Nähnadel"
"Namen"
"Narbe"
"Narwal"
"Nasenbär"
"Natur"
"Nebel"
"necken"
"Neffe"
"Neigung"
"Nektar"
"Nenner"
"Neptun"
"Nerz"
"Nessel"
"Nestbau"
"Netz"
"Neubau"
"Neuerung"
"Neugier"
"nicken"
"Niere"
"Nilpferd"
"nisten"
"Nocke"
"Nomade"
"Nordmeer"
"Notdurft"
"Notstand"
"Notwehr"
"Nudismus"
"Nuss"
"Nutzhanf"
"Oase"
"Obdach"
"Oberarzt"
"Objekt"
"Oboe"
"Obsthain"
"Ochse"
"Odyssee"
"Ofenholz"
"öffnen"
"Ohnmacht"
"Ohrfeige"
"Ohrwurm"
"Ökologie"
"Oktave"
"Ölberg"
"Olive"
"Ölkrise"
"Omelett"
"Onkel"
"Oper"
"Optiker"
"Orange"
"Orchidee"
"ordnen"
"Orgasmus"
"Orkan"
"Ortskern"
"Ortung"
"Ostasien"
"Ozean"
"Paarlauf"
"Packeis"
"paddeln"
"Paket"
"Palast"
"Pandabär"
"Panik"
"Panorama"
"Panther"
"Papagei"
"Papier"
"Paprika"
"Paradies"
"Parka"
"Parodie"
"Partner"
"Passant"
"Patent"
"Patzer"
"Pause"
"Pavian"
"Pedal"
"Pegel"
"peilen"
"Perle"
"Person"
"Pfad"
"Pfau"
"Pferd"
"Pfleger"
"Physik"
"Pier"
"Pilotwal"
"Pinzette"
"Piste"
"Plakat"
"Plankton"
"Platin"
"Plombe"
"plündern"
"Pobacke"
"Pokal"
"polieren"
"Popmusik"
"Porträt"
"Posaune"
"Postamt"
"Pottwal"
"Pracht"
"Pranke"
"Preis"
"Primat"
"Prinzip"
"Protest"
"Proviant"
"Prüfung"
"Pubertät"
"Pudding"
"Pullover"
"Pulsader"
"Punkt"
"Pute"
"Putsch"
"Puzzle"
"Python"
"quaken"
"Qualle"
"Quark"
"Quellsee"
"Querkopf"
"Quitte"
"Quote"
"Rabauke"
"Rache"
"Radclub"
"Radhose"
"Radio"
"Radtour"
"Rahmen"
"Rampe"
"Randlage"
"Ranzen"
"Rapsöl"
"Raserei"
"rasten"
"Rasur"
"Rätsel"
"Raubtier"
"Raumzeit"
"Rausch"
"Reaktor"
"Realität"
"Rebell"
"Rede"
"Reetdach"
"Regatta"
"Regen"
"Rehkitz"
"Reifen"
"Reim"
"Reise"
"Reizung"
"Rekord"
"Relevanz"
"Rennboot"
"Respekt"
"Restmüll"
"retten"
"Reue"
"Revolte"
"Rhetorik"
"Rhythmus"
"Richtung"
"Riegel"
"Rindvieh"
"Rippchen"
"Ritter"
"Robbe"
"Roboter"
"Rockband"
"Rohdaten"
"Roller"
"Roman"
"röntgen"
"Rose"
"Rosskur"
"Rost"
"Rotahorn"
"Rotglut"
"Rotznase"
"Rubrik"
"Rückweg"
"Rufmord"
"Ruhe"
"Ruine"
"Rumpf"
"Runde"
"Rüstung"
"rütteln"
"Saaltür"
"Saatguts"
"Säbel"
"Sachbuch"
"Sack"
"Saft"
"sagen"
"Sahneeis"
"Salat"
"Salbe"
"Salz"
"Sammlung"
"Samt"
"Sandbank"
"Sanftmut"
"Sardine"
"Satire"
"Sattel"
"Satzbau"
"Sauerei"
"Saum"
"Säure"
"Schall"
"Scheitel"
"Schiff"
"Schlager"
"Schmied"
"Schnee"
"Scholle"
"Schrank"
"Schulbus"
"Schwan"
"Seeadler"
"Seefahrt"
"Seehund"
"Seeufer"
"segeln"
"Sehnerv"
"Seide"
"Seilzug"
"Senf"
"Sessel"
"Seufzer"
"Sexgott"
"Sichtung"
"Signal"
"Silber"
"singen"
"Sinn"
"Sirup"
"Sitzbank"
"Skandal"
"Skikurs"
"Skipper"
"Skizze"
"Smaragd"
"Socke"
"Sohn"
"Sommer"
"Songtext"
"Sorte"
"Spagat"
"Spannung"
"Spargel"
"Specht"
"Speiseöl"
"Spiegel"
"Sport"
"spülen"
"Stadtbus"
"Stall"
"Stärke"
"Stativ"
"staunen"
"Stern"
"Stiftung"
"Stollen"
"Strömung"
"Sturm"
"Substanz"
"Südalpen"
"Sumpf"
"surfen"
"Tabak"
"Tafel"
"Tagebau"
"takeln"
"Taktung"
"Talsohle"
"Tand"
"Tanzbär"
"Tapir"
"Tarantel"
"Tarnname"
"Tasse"
"Tatnacht"
"Tatsache"
"Tatze"
"Taube"
"tauchen"
"Taufpate"
"Taumel"
"Teelicht"
"Teich"
"teilen"
"Tempo"
"Tenor"
"Terrasse"
"Testflug"
"Theater"
"Thermik"
"ticken"
"Tiefflug"
"Tierart"
"Tigerhai"
"Tinte"
"Tischler"
"toben"
"Toleranz"
"Tölpel"
"Tonband"
"Topf"
"Topmodel"
"Torbogen"
"Torlinie"
"Torte"
"Tourist"
"Tragesel"
"trampeln"
"Trapez"
"Traum"
"treffen"
"Trennung"
"Treue"
"Trick"
"trimmen"
"Trödel"
"Trost"
"Trumpf"
"tüfteln"
"Turban"
"Turm"
"Übermut"
"Ufer"
"Uhrwerk"
"umarmen"
"Umbau"
"Umfeld"
"Umgang"
"Umsturz"
"Unart"
"Unfug"
"Unimog"
"Unruhe"
"Unwucht"
"Uranerz"
"Urlaub"
"Urmensch"
"Utopie"
"Vakuum"
"Valuta"
"Vandale"
"Vase"
"Vektor"
"Ventil"
"Verb"
"Verdeck"
"Verfall"
"Vergaser"
"verhexen"
"Verlag"
"Vers"
"Vesper"
"Vieh"
"Viereck"
"Vinyl"
"Virus"
"Vitrine"
"Vollblut"
"Vorbote"
"Vorrat"
"Vorsicht"
"Vulkan"
"Wachstum"
"Wade"
"Wagemut"
"Wahlen"
"Wahrheit"
"Wald"
"Walhai"
"Wallach"
"Walnuss"
"Walzer"
"wandeln"
"Wanze"
"wärmen"
"Warnruf"
"Wäsche"
"Wasser"
"Weberei"
"wechseln"
"Wegegeld"
"wehren"
"Weiher"
"Weinglas"
"Weißbier"
"Weitwurf"
"Welle"
"Weltall"
"Werkbank"
"Werwolf"
"Wetter"
"wiehern"
"Wildgans"
"Wind"
"Wohl"
"Wohnort"
"Wolf"
"Wollust"
"Wortlaut"
"Wrack"
"Wunder"
"Wurfaxt"
"Wurst"
"Yacht"
"Yeti"
"Zacke"
"Zahl"
"zähmen"
"Zahnfee"
"Zäpfchen"
"Zaster"
"Zaumzeug"
"Zebra"
"zeigen"
"Zeitlupe"
"Zellkern"
"Zeltdach"
"Zensor"
"Zerfall"
"Zeug"
"Ziege"
"Zielfoto"
"Zimteis"
"Zobel"
"Zollhund"
"Zombie"
"Zöpfe"
"Zucht"
"Zufahrt"
"Zugfahrt"
"Zugvogel"
"Zündung"
"Zweck"
"Zyklop"))
| 43,511 | Common Lisp | .lisp | 1,633 | 8.600735 | 60 | 0.25729 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | ce3f5c3790d0a1dae568983a8b37777eb2039b636d0d40af14d2e868fdd24306 | 8,073 | [
-1
] |
8,074 | chinese-simplified.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/chinese-simplified.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :chinese-simplified
1
#("的"
"一"
"是"
"在"
"不"
"了"
"有"
"和"
"人"
"这"
"中"
"大"
"为"
"上"
"个"
"国"
"我"
"以"
"要"
"他"
"时"
"来"
"用"
"们"
"生"
"到"
"作"
"地"
"于"
"出"
"就"
"分"
"对"
"成"
"会"
"可"
"主"
"发"
"年"
"动"
"同"
"工"
"也"
"能"
"下"
"过"
"子"
"说"
"产"
"种"
"面"
"而"
"方"
"后"
"多"
"定"
"行"
"学"
"法"
"所"
"民"
"得"
"经"
"十"
"三"
"之"
"进"
"着"
"等"
"部"
"度"
"家"
"电"
"力"
"里"
"如"
"水"
"化"
"高"
"自"
"二"
"理"
"起"
"小"
"物"
"现"
"实"
"加"
"量"
"都"
"两"
"体"
"制"
"机"
"当"
"使"
"点"
"从"
"业"
"本"
"去"
"把"
"性"
"好"
"应"
"开"
"它"
"合"
"还"
"因"
"由"
"其"
"些"
"然"
"前"
"外"
"天"
"政"
"四"
"日"
"那"
"社"
"义"
"事"
"平"
"形"
"相"
"全"
"表"
"间"
"样"
"与"
"关"
"各"
"重"
"新"
"线"
"内"
"数"
"正"
"心"
"反"
"你"
"明"
"看"
"原"
"又"
"么"
"利"
"比"
"或"
"但"
"质"
"气"
"第"
"向"
"道"
"命"
"此"
"变"
"条"
"只"
"没"
"结"
"解"
"问"
"意"
"建"
"月"
"公"
"无"
"系"
"军"
"很"
"情"
"者"
"最"
"立"
"代"
"想"
"已"
"通"
"并"
"提"
"直"
"题"
"党"
"程"
"展"
"五"
"果"
"料"
"象"
"员"
"革"
"位"
"入"
"常"
"文"
"总"
"次"
"品"
"式"
"活"
"设"
"及"
"管"
"特"
"件"
"长"
"求"
"老"
"头"
"基"
"资"
"边"
"流"
"路"
"级"
"少"
"图"
"山"
"统"
"接"
"知"
"较"
"将"
"组"
"见"
"计"
"别"
"她"
"手"
"角"
"期"
"根"
"论"
"运"
"农"
"指"
"几"
"九"
"区"
"强"
"放"
"决"
"西"
"被"
"干"
"做"
"必"
"战"
"先"
"回"
"则"
"任"
"取"
"据"
"处"
"队"
"南"
"给"
"色"
"光"
"门"
"即"
"保"
"治"
"北"
"造"
"百"
"规"
"热"
"领"
"七"
"海"
"口"
"东"
"导"
"器"
"压"
"志"
"世"
"金"
"增"
"争"
"济"
"阶"
"油"
"思"
"术"
"极"
"交"
"受"
"联"
"什"
"认"
"六"
"共"
"权"
"收"
"证"
"改"
"清"
"美"
"再"
"采"
"转"
"更"
"单"
"风"
"切"
"打"
"白"
"教"
"速"
"花"
"带"
"安"
"场"
"身"
"车"
"例"
"真"
"务"
"具"
"万"
"每"
"目"
"至"
"达"
"走"
"积"
"示"
"议"
"声"
"报"
"斗"
"完"
"类"
"八"
"离"
"华"
"名"
"确"
"才"
"科"
"张"
"信"
"马"
"节"
"话"
"米"
"整"
"空"
"元"
"况"
"今"
"集"
"温"
"传"
"土"
"许"
"步"
"群"
"广"
"石"
"记"
"需"
"段"
"研"
"界"
"拉"
"林"
"律"
"叫"
"且"
"究"
"观"
"越"
"织"
"装"
"影"
"算"
"低"
"持"
"音"
"众"
"书"
"布"
"复"
"容"
"儿"
"须"
"际"
"商"
"非"
"验"
"连"
"断"
"深"
"难"
"近"
"矿"
"千"
"周"
"委"
"素"
"技"
"备"
"半"
"办"
"青"
"省"
"列"
"习"
"响"
"约"
"支"
"般"
"史"
"感"
"劳"
"便"
"团"
"往"
"酸"
"历"
"市"
"克"
"何"
"除"
"消"
"构"
"府"
"称"
"太"
"准"
"精"
"值"
"号"
"率"
"族"
"维"
"划"
"选"
"标"
"写"
"存"
"候"
"毛"
"亲"
"快"
"效"
"斯"
"院"
"查"
"江"
"型"
"眼"
"王"
"按"
"格"
"养"
"易"
"置"
"派"
"层"
"片"
"始"
"却"
"专"
"状"
"育"
"厂"
"京"
"识"
"适"
"属"
"圆"
"包"
"火"
"住"
"调"
"满"
"县"
"局"
"照"
"参"
"红"
"细"
"引"
"听"
"该"
"铁"
"价"
"严"
"首"
"底"
"液"
"官"
"德"
"随"
"病"
"苏"
"失"
"尔"
"死"
"讲"
"配"
"女"
"黄"
"推"
"显"
"谈"
"罪"
"神"
"艺"
"呢"
"席"
"含"
"企"
"望"
"密"
"批"
"营"
"项"
"防"
"举"
"球"
"英"
"氧"
"势"
"告"
"李"
"台"
"落"
"木"
"帮"
"轮"
"破"
"亚"
"师"
"围"
"注"
"远"
"字"
"材"
"排"
"供"
"河"
"态"
"封"
"另"
"施"
"减"
"树"
"溶"
"怎"
"止"
"案"
"言"
"士"
"均"
"武"
"固"
"叶"
"鱼"
"波"
"视"
"仅"
"费"
"紧"
"爱"
"左"
"章"
"早"
"朝"
"害"
"续"
"轻"
"服"
"试"
"食"
"充"
"兵"
"源"
"判"
"护"
"司"
"足"
"某"
"练"
"差"
"致"
"板"
"田"
"降"
"黑"
"犯"
"负"
"击"
"范"
"继"
"兴"
"似"
"余"
"坚"
"曲"
"输"
"修"
"故"
"城"
"夫"
"够"
"送"
"笔"
"船"
"占"
"右"
"财"
"吃"
"富"
"春"
"职"
"觉"
"汉"
"画"
"功"
"巴"
"跟"
"虽"
"杂"
"飞"
"检"
"吸"
"助"
"升"
"阳"
"互"
"初"
"创"
"抗"
"考"
"投"
"坏"
"策"
"古"
"径"
"换"
"未"
"跑"
"留"
"钢"
"曾"
"端"
"责"
"站"
"简"
"述"
"钱"
"副"
"尽"
"帝"
"射"
"草"
"冲"
"承"
"独"
"令"
"限"
"阿"
"宣"
"环"
"双"
"请"
"超"
"微"
"让"
"控"
"州"
"良"
"轴"
"找"
"否"
"纪"
"益"
"依"
"优"
"顶"
"础"
"载"
"倒"
"房"
"突"
"坐"
"粉"
"敌"
"略"
"客"
"袁"
"冷"
"胜"
"绝"
"析"
"块"
"剂"
"测"
"丝"
"协"
"诉"
"念"
"陈"
"仍"
"罗"
"盐"
"友"
"洋"
"错"
"苦"
"夜"
"刑"
"移"
"频"
"逐"
"靠"
"混"
"母"
"短"
"皮"
"终"
"聚"
"汽"
"村"
"云"
"哪"
"既"
"距"
"卫"
"停"
"烈"
"央"
"察"
"烧"
"迅"
"境"
"若"
"印"
"洲"
"刻"
"括"
"激"
"孔"
"搞"
"甚"
"室"
"待"
"核"
"校"
"散"
"侵"
"吧"
"甲"
"游"
"久"
"菜"
"味"
"旧"
"模"
"湖"
"货"
"损"
"预"
"阻"
"毫"
"普"
"稳"
"乙"
"妈"
"植"
"息"
"扩"
"银"
"语"
"挥"
"酒"
"守"
"拿"
"序"
"纸"
"医"
"缺"
"雨"
"吗"
"针"
"刘"
"啊"
"急"
"唱"
"误"
"训"
"愿"
"审"
"附"
"获"
"茶"
"鲜"
"粮"
"斤"
"孩"
"脱"
"硫"
"肥"
"善"
"龙"
"演"
"父"
"渐"
"血"
"欢"
"械"
"掌"
"歌"
"沙"
"刚"
"攻"
"谓"
"盾"
"讨"
"晚"
"粒"
"乱"
"燃"
"矛"
"乎"
"杀"
"药"
"宁"
"鲁"
"贵"
"钟"
"煤"
"读"
"班"
"伯"
"香"
"介"
"迫"
"句"
"丰"
"培"
"握"
"兰"
"担"
"弦"
"蛋"
"沉"
"假"
"穿"
"执"
"答"
"乐"
"谁"
"顺"
"烟"
"缩"
"征"
"脸"
"喜"
"松"
"脚"
"困"
"异"
"免"
"背"
"星"
"福"
"买"
"染"
"井"
"概"
"慢"
"怕"
"磁"
"倍"
"祖"
"皇"
"促"
"静"
"补"
"评"
"翻"
"肉"
"践"
"尼"
"衣"
"宽"
"扬"
"棉"
"希"
"伤"
"操"
"垂"
"秋"
"宜"
"氢"
"套"
"督"
"振"
"架"
"亮"
"末"
"宪"
"庆"
"编"
"牛"
"触"
"映"
"雷"
"销"
"诗"
"座"
"居"
"抓"
"裂"
"胞"
"呼"
"娘"
"景"
"威"
"绿"
"晶"
"厚"
"盟"
"衡"
"鸡"
"孙"
"延"
"危"
"胶"
"屋"
"乡"
"临"
"陆"
"顾"
"掉"
"呀"
"灯"
"岁"
"措"
"束"
"耐"
"剧"
"玉"
"赵"
"跳"
"哥"
"季"
"课"
"凯"
"胡"
"额"
"款"
"绍"
"卷"
"齐"
"伟"
"蒸"
"殖"
"永"
"宗"
"苗"
"川"
"炉"
"岩"
"弱"
"零"
"杨"
"奏"
"沿"
"露"
"杆"
"探"
"滑"
"镇"
"饭"
"浓"
"航"
"怀"
"赶"
"库"
"夺"
"伊"
"灵"
"税"
"途"
"灭"
"赛"
"归"
"召"
"鼓"
"播"
"盘"
"裁"
"险"
"康"
"唯"
"录"
"菌"
"纯"
"借"
"糖"
"盖"
"横"
"符"
"私"
"努"
"堂"
"域"
"枪"
"润"
"幅"
"哈"
"竟"
"熟"
"虫"
"泽"
"脑"
"壤"
"碳"
"欧"
"遍"
"侧"
"寨"
"敢"
"彻"
"虑"
"斜"
"薄"
"庭"
"纳"
"弹"
"饲"
"伸"
"折"
"麦"
"湿"
"暗"
"荷"
"瓦"
"塞"
"床"
"筑"
"恶"
"户"
"访"
"塔"
"奇"
"透"
"梁"
"刀"
"旋"
"迹"
"卡"
"氯"
"遇"
"份"
"毒"
"泥"
"退"
"洗"
"摆"
"灰"
"彩"
"卖"
"耗"
"夏"
"择"
"忙"
"铜"
"献"
"硬"
"予"
"繁"
"圈"
"雪"
"函"
"亦"
"抽"
"篇"
"阵"
"阴"
"丁"
"尺"
"追"
"堆"
"雄"
"迎"
"泛"
"爸"
"楼"
"避"
"谋"
"吨"
"野"
"猪"
"旗"
"累"
"偏"
"典"
"馆"
"索"
"秦"
"脂"
"潮"
"爷"
"豆"
"忽"
"托"
"惊"
"塑"
"遗"
"愈"
"朱"
"替"
"纤"
"粗"
"倾"
"尚"
"痛"
"楚"
"谢"
"奋"
"购"
"磨"
"君"
"池"
"旁"
"碎"
"骨"
"监"
"捕"
"弟"
"暴"
"割"
"贯"
"殊"
"释"
"词"
"亡"
"壁"
"顿"
"宝"
"午"
"尘"
"闻"
"揭"
"炮"
"残"
"冬"
"桥"
"妇"
"警"
"综"
"招"
"吴"
"付"
"浮"
"遭"
"徐"
"您"
"摇"
"谷"
"赞"
"箱"
"隔"
"订"
"男"
"吹"
"园"
"纷"
"唐"
"败"
"宋"
"玻"
"巨"
"耕"
"坦"
"荣"
"闭"
"湾"
"键"
"凡"
"驻"
"锅"
"救"
"恩"
"剥"
"凝"
"碱"
"齿"
"截"
"炼"
"麻"
"纺"
"禁"
"废"
"盛"
"版"
"缓"
"净"
"睛"
"昌"
"婚"
"涉"
"筒"
"嘴"
"插"
"岸"
"朗"
"庄"
"街"
"藏"
"姑"
"贸"
"腐"
"奴"
"啦"
"惯"
"乘"
"伙"
"恢"
"匀"
"纱"
"扎"
"辩"
"耳"
"彪"
"臣"
"亿"
"璃"
"抵"
"脉"
"秀"
"萨"
"俄"
"网"
"舞"
"店"
"喷"
"纵"
"寸"
"汗"
"挂"
"洪"
"贺"
"闪"
"柬"
"爆"
"烯"
"津"
"稻"
"墙"
"软"
"勇"
"像"
"滚"
"厘"
"蒙"
"芳"
"肯"
"坡"
"柱"
"荡"
"腿"
"仪"
"旅"
"尾"
"轧"
"冰"
"贡"
"登"
"黎"
"削"
"钻"
"勒"
"逃"
"障"
"氨"
"郭"
"峰"
"币"
"港"
"伏"
"轨"
"亩"
"毕"
"擦"
"莫"
"刺"
"浪"
"秘"
"援"
"株"
"健"
"售"
"股"
"岛"
"甘"
"泡"
"睡"
"童"
"铸"
"汤"
"阀"
"休"
"汇"
"舍"
"牧"
"绕"
"炸"
"哲"
"磷"
"绩"
"朋"
"淡"
"尖"
"启"
"陷"
"柴"
"呈"
"徒"
"颜"
"泪"
"稍"
"忘"
"泵"
"蓝"
"拖"
"洞"
"授"
"镜"
"辛"
"壮"
"锋"
"贫"
"虚"
"弯"
"摩"
"泰"
"幼"
"廷"
"尊"
"窗"
"纲"
"弄"
"隶"
"疑"
"氏"
"宫"
"姐"
"震"
"瑞"
"怪"
"尤"
"琴"
"循"
"描"
"膜"
"违"
"夹"
"腰"
"缘"
"珠"
"穷"
"森"
"枝"
"竹"
"沟"
"催"
"绳"
"忆"
"邦"
"剩"
"幸"
"浆"
"栏"
"拥"
"牙"
"贮"
"礼"
"滤"
"钠"
"纹"
"罢"
"拍"
"咱"
"喊"
"袖"
"埃"
"勤"
"罚"
"焦"
"潜"
"伍"
"墨"
"欲"
"缝"
"姓"
"刊"
"饱"
"仿"
"奖"
"铝"
"鬼"
"丽"
"跨"
"默"
"挖"
"链"
"扫"
"喝"
"袋"
"炭"
"污"
"幕"
"诸"
"弧"
"励"
"梅"
"奶"
"洁"
"灾"
"舟"
"鉴"
"苯"
"讼"
"抱"
"毁"
"懂"
"寒"
"智"
"埔"
"寄"
"届"
"跃"
"渡"
"挑"
"丹"
"艰"
"贝"
"碰"
"拔"
"爹"
"戴"
"码"
"梦"
"芽"
"熔"
"赤"
"渔"
"哭"
"敬"
"颗"
"奔"
"铅"
"仲"
"虎"
"稀"
"妹"
"乏"
"珍"
"申"
"桌"
"遵"
"允"
"隆"
"螺"
"仓"
"魏"
"锐"
"晓"
"氮"
"兼"
"隐"
"碍"
"赫"
"拨"
"忠"
"肃"
"缸"
"牵"
"抢"
"博"
"巧"
"壳"
"兄"
"杜"
"讯"
"诚"
"碧"
"祥"
"柯"
"页"
"巡"
"矩"
"悲"
"灌"
"龄"
"伦"
"票"
"寻"
"桂"
"铺"
"圣"
"恐"
"恰"
"郑"
"趣"
"抬"
"荒"
"腾"
"贴"
"柔"
"滴"
"猛"
"阔"
"辆"
"妻"
"填"
"撤"
"储"
"签"
"闹"
"扰"
"紫"
"砂"
"递"
"戏"
"吊"
"陶"
"伐"
"喂"
"疗"
"瓶"
"婆"
"抚"
"臂"
"摸"
"忍"
"虾"
"蜡"
"邻"
"胸"
"巩"
"挤"
"偶"
"弃"
"槽"
"劲"
"乳"
"邓"
"吉"
"仁"
"烂"
"砖"
"租"
"乌"
"舰"
"伴"
"瓜"
"浅"
"丙"
"暂"
"燥"
"橡"
"柳"
"迷"
"暖"
"牌"
"秧"
"胆"
"详"
"簧"
"踏"
"瓷"
"谱"
"呆"
"宾"
"糊"
"洛"
"辉"
"愤"
"竞"
"隙"
"怒"
"粘"
"乃"
"绪"
"肩"
"籍"
"敏"
"涂"
"熙"
"皆"
"侦"
"悬"
"掘"
"享"
"纠"
"醒"
"狂"
"锁"
"淀"
"恨"
"牲"
"霸"
"爬"
"赏"
"逆"
"玩"
"陵"
"祝"
"秒"
"浙"
"貌"))
| 37,678 | Common Lisp | .lisp | 1,633 | 3.143907 | 60 | 0.055415 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 2ce89dfe0b44efdc4304a4d7b70f7cece89c86c15b3c4c260c3a57808b8af4cf | 8,074 | [
-1
] |
8,075 | dutch.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/dutch.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :dutch
4
#("aalglad"
"aalscholver"
"aambeeld"
"aangeef"
"aanlandig"
"aanvaard"
"aanwakker"
"aapmens"
"aarten"
"abdicatie"
"abnormaal"
"abrikoos"
"accu"
"acuut"
"adjudant"
"admiraal"
"advies"
"afbidding"
"afdracht"
"affaire"
"affiche"
"afgang"
"afkick"
"afknap"
"aflees"
"afmijner"
"afname"
"afpreekt"
"afrader"
"afspeel"
"aftocht"
"aftrek"
"afzijdig"
"ahornboom"
"aktetas"
"akzo"
"alchemist"
"alcohol"
"aldaar"
"alexander"
"alfabet"
"alfredo"
"alice"
"alikruik"
"allrisk"
"altsax"
"alufolie"
"alziend"
"amai"
"ambacht"
"ambieer"
"amina"
"amnestie"
"amok"
"ampul"
"amuzikaal"
"angela"
"aniek"
"antje"
"antwerpen"
"anya"
"aorta"
"apache"
"apekool"
"appelaar"
"arganolie"
"argeloos"
"armoede"
"arrenslee"
"artritis"
"arubaan"
"asbak"
"ascii"
"asgrauw"
"asjes"
"asml"
"aspunt"
"asurn"
"asveld"
"aterling"
"atomair"
"atrium"
"atsma"
"atypisch"
"auping"
"aura"
"avifauna"
"axiaal"
"azoriaan"
"azteek"
"azuur"
"bachelor"
"badderen"
"badhotel"
"badmantel"
"badsteden"
"balie"
"ballans"
"balvers"
"bamibal"
"banneling"
"barracuda"
"basaal"
"batelaan"
"batje"
"beambte"
"bedlamp"
"bedwelmd"
"befaamd"
"begierd"
"begraaf"
"behield"
"beijaard"
"bejaagd"
"bekaaid"
"beks"
"bektas"
"belaad"
"belboei"
"belderbos"
"beloerd"
"beluchten"
"bemiddeld"
"benadeeld"
"benijd"
"berechten"
"beroemd"
"besef"
"besseling"
"best"
"betichten"
"bevind"
"bevochten"
"bevraagd"
"bewust"
"bidplaats"
"biefstuk"
"biemans"
"biezen"
"bijbaan"
"bijeenkom"
"bijfiguur"
"bijkaart"
"bijlage"
"bijpaard"
"bijtgaar"
"bijweg"
"bimmel"
"binck"
"bint"
"biobak"
"biotisch"
"biseks"
"bistro"
"bitter"
"bitumen"
"bizar"
"blad"
"bleken"
"blender"
"bleu"
"blief"
"blijven"
"blozen"
"bock"
"boef"
"boei"
"boks"
"bolder"
"bolus"
"bolvormig"
"bomaanval"
"bombarde"
"bomma"
"bomtapijt"
"bookmaker"
"boos"
"borg"
"bosbes"
"boshuizen"
"bosloop"
"botanicus"
"bougie"
"bovag"
"boxspring"
"braad"
"brasem"
"brevet"
"brigade"
"brinckman"
"bruid"
"budget"
"buffel"
"buks"
"bulgaar"
"buma"
"butaan"
"butler"
"buuf"
"cactus"
"cafeetje"
"camcorder"
"cannabis"
"canyon"
"capoeira"
"capsule"
"carkit"
"casanova"
"catalaan"
"ceintuur"
"celdeling"
"celplasma"
"cement"
"censeren"
"ceramisch"
"cerberus"
"cerebraal"
"cesium"
"cirkel"
"citeer"
"civiel"
"claxon"
"clenbuterol"
"clicheren"
"clijsen"
"coalitie"
"coassistentschap"
"coaxiaal"
"codetaal"
"cofinanciering"
"cognac"
"coltrui"
"comfort"
"commandant"
"condensaat"
"confectie"
"conifeer"
"convector"
"copier"
"corfu"
"correct"
"coup"
"couvert"
"creatie"
"credit"
"crematie"
"cricket"
"croupier"
"cruciaal"
"cruijff"
"cuisine"
"culemborg"
"culinair"
"curve"
"cyrano"
"dactylus"
"dading"
"dagblind"
"dagje"
"daglicht"
"dagprijs"
"dagranden"
"dakdekker"
"dakpark"
"dakterras"
"dalgrond"
"dambord"
"damkat"
"damlengte"
"damman"
"danenberg"
"debbie"
"decibel"
"defect"
"deformeer"
"degelijk"
"degradant"
"dejonghe"
"dekken"
"deppen"
"derek"
"derf"
"derhalve"
"detineren"
"devalueer"
"diaken"
"dicht"
"dictaat"
"dief"
"digitaal"
"dijbreuk"
"dijkmans"
"dimbaar"
"dinsdag"
"diode"
"dirigeer"
"disbalans"
"dobermann"
"doenbaar"
"doerak"
"dogma"
"dokhaven"
"dokwerker"
"doling"
"dolphijn"
"dolven"
"dombo"
"dooraderd"
"dopeling"
"doping"
"draderig"
"drama"
"drenkbak"
"dreumes"
"drol"
"drug"
"duaal"
"dublin"
"duplicaat"
"durven"
"dusdanig"
"dutchbat"
"dutje"
"dutten"
"duur"
"duwwerk"
"dwaal"
"dweil"
"dwing"
"dyslexie"
"ecostroom"
"ecotaks"
"educatie"
"eeckhout"
"eede"
"eemland"
"eencellig"
"eeneiig"
"eenruiter"
"eenwinter"
"eerenberg"
"eerrover"
"eersel"
"eetmaal"
"efteling"
"egaal"
"egtberts"
"eickhoff"
"eidooier"
"eiland"
"eind"
"eisden"
"ekster"
"elburg"
"elevatie"
"elfkoppig"
"elfrink"
"elftal"
"elimineer"
"elleboog"
"elma"
"elodie"
"elsa"
"embleem"
"embolie"
"emoe"
"emonds"
"emplooi"
"enduro"
"enfin"
"engageer"
"entourage"
"entstof"
"epileer"
"episch"
"eppo"
"erasmus"
"erboven"
"erebaan"
"erelijst"
"ereronden"
"ereteken"
"erfhuis"
"erfwet"
"erger"
"erica"
"ermitage"
"erna"
"ernie"
"erts"
"ertussen"
"eruitzien"
"ervaar"
"erven"
"erwt"
"esbeek"
"escort"
"esdoorn"
"essing"
"etage"
"eter"
"ethanol"
"ethicus"
"etholoog"
"eufonisch"
"eurocent"
"evacuatie"
"exact"
"examen"
"executant"
"exen"
"exit"
"exogeen"
"exotherm"
"expeditie"
"expletief"
"expres"
"extase"
"extinctie"
"faal"
"faam"
"fabel"
"facultair"
"fakir"
"fakkel"
"faliekant"
"fallisch"
"famke"
"fanclub"
"fase"
"fatsoen"
"fauna"
"federaal"
"feedback"
"feest"
"feilbaar"
"feitelijk"
"felblauw"
"figurante"
"fiod"
"fitheid"
"fixeer"
"flap"
"fleece"
"fleur"
"flexibel"
"flits"
"flos"
"flow"
"fluweel"
"foezelen"
"fokkelman"
"fokpaard"
"fokvee"
"folder"
"follikel"
"folmer"
"folteraar"
"fooi"
"foolen"
"forfait"
"forint"
"formule"
"fornuis"
"fosfaat"
"foxtrot"
"foyer"
"fragiel"
"frater"
"freak"
"freddie"
"fregat"
"freon"
"frijnen"
"fructose"
"frunniken"
"fuiven"
"funshop"
"furieus"
"fysica"
"gadget"
"galder"
"galei"
"galg"
"galvlieg"
"galzuur"
"ganesh"
"gaswet"
"gaza"
"gazelle"
"geaaid"
"gebiecht"
"gebufferd"
"gedijd"
"geef"
"geflanst"
"gefreesd"
"gegaan"
"gegijzeld"
"gegniffel"
"gegraaid"
"gehikt"
"gehobbeld"
"gehucht"
"geiser"
"geiten"
"gekaakt"
"gekheid"
"gekijf"
"gekmakend"
"gekocht"
"gekskap"
"gekte"
"gelubberd"
"gemiddeld"
"geordend"
"gepoederd"
"gepuft"
"gerda"
"gerijpt"
"geseald"
"geshockt"
"gesierd"
"geslaagd"
"gesnaaid"
"getracht"
"getwijfel"
"geuit"
"gevecht"
"gevlagd"
"gewicht"
"gezaagd"
"gezocht"
"ghanees"
"giebelen"
"giechel"
"giepmans"
"gips"
"giraal"
"gistachtig"
"gitaar"
"glaasje"
"gletsjer"
"gleuf"
"glibberen"
"glijbaan"
"gloren"
"gluipen"
"gluren"
"gluur"
"gnoe"
"goddelijk"
"godgans"
"godschalk"
"godzalig"
"goeierd"
"gogme"
"goklustig"
"gokwereld"
"gonggrijp"
"gonje"
"goor"
"grabbel"
"graf"
"graveer"
"grif"
"grolleman"
"grom"
"groosman"
"grubben"
"gruijs"
"grut"
"guacamole"
"guido"
"guppy"
"haazen"
"hachelijk"
"haex"
"haiku"
"hakhout"
"hakken"
"hanegem"
"hans"
"hanteer"
"harrie"
"hazebroek"
"hedonist"
"heil"
"heineken"
"hekhuis"
"hekman"
"helbig"
"helga"
"helwegen"
"hengelaar"
"herkansen"
"hermafrodiet"
"hertaald"
"hiaat"
"hikspoors"
"hitachi"
"hitparade"
"hobo"
"hoeve"
"holocaust"
"hond"
"honnepon"
"hoogacht"
"hotelbed"
"hufter"
"hugo"
"huilbier"
"hulk"
"humus"
"huwbaar"
"huwelijk"
"hype"
"iconisch"
"idema"
"ideogram"
"idolaat"
"ietje"
"ijker"
"ijkheid"
"ijklijn"
"ijkmaat"
"ijkwezen"
"ijmuiden"
"ijsbox"
"ijsdag"
"ijselijk"
"ijskoud"
"ilse"
"immuun"
"impliceer"
"impuls"
"inbijten"
"inbuigen"
"indijken"
"induceer"
"indy"
"infecteer"
"inhaak"
"inkijk"
"inluiden"
"inmijnen"
"inoefenen"
"inpolder"
"inrijden"
"inslaan"
"invitatie"
"inwaaien"
"ionisch"
"isaac"
"isolatie"
"isotherm"
"isra"
"italiaan"
"ivoor"
"jacobs"
"jakob"
"jammen"
"jampot"
"jarig"
"jehova"
"jenever"
"jezus"
"joana"
"jobdienst"
"josua"
"joule"
"juich"
"jurk"
"juut"
"kaas"
"kabelaar"
"kabinet"
"kagenaar"
"kajuit"
"kalebas"
"kalm"
"kanjer"
"kapucijn"
"karregat"
"kart"
"katvanger"
"katwijk"
"kegelaar"
"keiachtig"
"keizer"
"kenletter"
"kerdijk"
"keus"
"kevlar"
"kezen"
"kickback"
"kieviet"
"kijken"
"kikvors"
"kilheid"
"kilobit"
"kilsdonk"
"kipschnitzel"
"kissebis"
"klad"
"klagelijk"
"klak"
"klapbaar"
"klaver"
"klene"
"klets"
"klijnhout"
"klit"
"klok"
"klonen"
"klotefilm"
"kluif"
"klumper"
"klus"
"knabbel"
"knagen"
"knaven"
"kneedbaar"
"knmi"
"knul"
"knus"
"kokhals"
"komiek"
"komkommer"
"kompaan"
"komrij"
"komvormig"
"koning"
"kopbal"
"kopklep"
"kopnagel"
"koppejan"
"koptekst"
"kopwand"
"koraal"
"kosmisch"
"kostbaar"
"kram"
"kraneveld"
"kras"
"kreling"
"krengen"
"kribbe"
"krik"
"kruid"
"krulbol"
"kuijper"
"kuipbank"
"kuit"
"kuiven"
"kutsmoes"
"kuub"
"kwak"
"kwatong"
"kwetsbaar"
"kwezelaar"
"kwijnen"
"kwik"
"kwinkslag"
"kwitantie"
"lading"
"lakbeits"
"lakken"
"laklaag"
"lakmoes"
"lakwijk"
"lamheid"
"lamp"
"lamsbout"
"lapmiddel"
"larve"
"laser"
"latijn"
"latuw"
"lawaai"
"laxeerpil"
"lebberen"
"ledeboer"
"leefbaar"
"leeman"
"lefdoekje"
"lefhebber"
"legboor"
"legsel"
"leguaan"
"leiplaat"
"lekdicht"
"lekrijden"
"leksteen"
"lenen"
"leraar"
"lesbienne"
"leugenaar"
"leut"
"lexicaal"
"lezing"
"lieten"
"liggeld"
"lijdzaam"
"lijk"
"lijmstang"
"lijnschip"
"likdoorn"
"likken"
"liksteen"
"limburg"
"link"
"linoleum"
"lipbloem"
"lipman"
"lispelen"
"lissabon"
"litanie"
"liturgie"
"lochem"
"loempia"
"loesje"
"logheid"
"lonen"
"lonneke"
"loom"
"loos"
"losbaar"
"loslaten"
"losplaats"
"loting"
"lotnummer"
"lots"
"louie"
"lourdes"
"louter"
"lowbudget"
"luijten"
"luikenaar"
"luilak"
"luipaard"
"luizenbos"
"lulkoek"
"lumen"
"lunzen"
"lurven"
"lutjeboer"
"luttel"
"lutz"
"luuk"
"luwte"
"luyendijk"
"lyceum"
"lynx"
"maakbaar"
"magdalena"
"malheid"
"manchet"
"manfred"
"manhaftig"
"mank"
"mantel"
"marion"
"marxist"
"masmeijer"
"massaal"
"matsen"
"matverf"
"matze"
"maude"
"mayonaise"
"mechanica"
"meifeest"
"melodie"
"meppelink"
"midvoor"
"midweeks"
"midzomer"
"miezel"
"mijnraad"
"minus"
"mirck"
"mirte"
"mispakken"
"misraden"
"miswassen"
"mitella"
"moker"
"molecule"
"mombakkes"
"moonen"
"mopperaar"
"moraal"
"morgana"
"mormel"
"mosselaar"
"motregen"
"mouw"
"mufheid"
"mutueel"
"muzelman"
"naaidoos"
"naald"
"nadeel"
"nadruk"
"nagy"
"nahon"
"naima"
"nairobi"
"napalm"
"napels"
"napijn"
"napoleon"
"narigheid"
"narratief"
"naseizoen"
"nasibal"
"navigatie"
"nawijn"
"negatief"
"nekletsel"
"nekwervel"
"neolatijn"
"neonataal"
"neptunus"
"nerd"
"nest"
"neuzelaar"
"nihiliste"
"nijenhuis"
"nijging"
"nijhoff"
"nijl"
"nijptang"
"nippel"
"nokkenas"
"noordam"
"noren"
"normaal"
"nottelman"
"notulant"
"nout"
"nuance"
"nuchter"
"nudorp"
"nulde"
"nullijn"
"nulmeting"
"nunspeet"
"nylon"
"obelisk"
"object"
"oblie"
"obsceen"
"occlusie"
"oceaan"
"ochtend"
"ockhuizen"
"oerdom"
"oergezond"
"oerlaag"
"oester"
"okhuijsen"
"olifant"
"olijfboer"
"omaans"
"ombudsman"
"omdat"
"omdijken"
"omdoen"
"omgebouwd"
"omkeer"
"omkomen"
"ommegaand"
"ommuren"
"omroep"
"omruil"
"omslaan"
"omsmeden"
"omvaar"
"onaardig"
"onedel"
"onenig"
"onheilig"
"onrecht"
"onroerend"
"ontcijfer"
"onthaal"
"ontvallen"
"ontzadeld"
"onzacht"
"onzin"
"onzuiver"
"oogappel"
"ooibos"
"ooievaar"
"ooit"
"oorarts"
"oorhanger"
"oorijzer"
"oorklep"
"oorschelp"
"oorworm"
"oorzaak"
"opdagen"
"opdien"
"opdweilen"
"opel"
"opgebaard"
"opinie"
"opjutten"
"opkijken"
"opklaar"
"opkuisen"
"opkwam"
"opnaaien"
"opossum"
"opsieren"
"opsmeer"
"optreden"
"opvijzel"
"opvlammen"
"opwind"
"oraal"
"orchidee"
"orkest"
"ossuarium"
"ostendorf"
"oublie"
"oudachtig"
"oudbakken"
"oudnoors"
"oudshoorn"
"oudtante"
"oven"
"over"
"oxidant"
"pablo"
"pacht"
"paktafel"
"pakzadel"
"paljas"
"panharing"
"papfles"
"paprika"
"parochie"
"paus"
"pauze"
"paviljoen"
"peek"
"pegel"
"peigeren"
"pekela"
"pendant"
"penibel"
"pepmiddel"
"peptalk"
"periferie"
"perron"
"pessarium"
"peter"
"petfles"
"petgat"
"peuk"
"pfeifer"
"picknick"
"pief"
"pieneman"
"pijlkruid"
"pijnacker"
"pijpelink"
"pikdonker"
"pikeer"
"pilaar"
"pionier"
"pipet"
"piscine"
"pissebed"
"pitchen"
"pixel"
"plamuren"
"plan"
"plausibel"
"plegen"
"plempen"
"pleonasme"
"plezant"
"podoloog"
"pofmouw"
"pokdalig"
"ponywagen"
"popachtig"
"popidool"
"porren"
"positie"
"potten"
"pralen"
"prezen"
"prijzen"
"privaat"
"proef"
"prooi"
"prozawerk"
"pruik"
"prul"
"publiceer"
"puck"
"puilen"
"pukkelig"
"pulveren"
"pupil"
"puppy"
"purmerend"
"pustjens"
"putemmer"
"puzzelaar"
"queenie"
"quiche"
"raam"
"raar"
"raat"
"raes"
"ralf"
"rally"
"ramona"
"ramselaar"
"ranonkel"
"rapen"
"rapunzel"
"rarekiek"
"rarigheid"
"rattenhol"
"ravage"
"reactie"
"recreant"
"redacteur"
"redster"
"reewild"
"regie"
"reijnders"
"rein"
"replica"
"revanche"
"rigide"
"rijbaan"
"rijdansen"
"rijgen"
"rijkdom"
"rijles"
"rijnwijn"
"rijpma"
"rijstafel"
"rijtaak"
"rijzwepen"
"rioleer"
"ripdeal"
"riphagen"
"riskant"
"rits"
"rivaal"
"robbedoes"
"robot"
"rockact"
"rodijk"
"rogier"
"rohypnol"
"rollaag"
"rolpaal"
"roltafel"
"roof"
"roon"
"roppen"
"rosbief"
"rosharig"
"rosielle"
"rotan"
"rotleven"
"rotten"
"rotvaart"
"royaal"
"royeer"
"rubato"
"ruby"
"ruche"
"rudge"
"ruggetje"
"rugnummer"
"rugpijn"
"rugtitel"
"rugzak"
"ruilbaar"
"ruis"
"ruit"
"rukwind"
"rulijs"
"rumoeren"
"rumsdorp"
"rumtaart"
"runnen"
"russchen"
"ruwkruid"
"saboteer"
"saksisch"
"salade"
"salpeter"
"sambabal"
"samsam"
"satelliet"
"satineer"
"saus"
"scampi"
"scarabee"
"scenario"
"schobben"
"schubben"
"scout"
"secessie"
"secondair"
"seculair"
"sediment"
"seeland"
"settelen"
"setwinst"
"sheriff"
"shiatsu"
"siciliaan"
"sidderaal"
"sigma"
"sijben"
"silvana"
"simkaart"
"sinds"
"situatie"
"sjaak"
"sjardijn"
"sjezen"
"sjor"
"skinhead"
"skylab"
"slamixen"
"sleijpen"
"slijkerig"
"slordig"
"slowaak"
"sluieren"
"smadelijk"
"smiecht"
"smoel"
"smos"
"smukken"
"snackcar"
"snavel"
"sneaker"
"sneu"
"snijdbaar"
"snit"
"snorder"
"soapbox"
"soetekouw"
"soigneren"
"sojaboon"
"solo"
"solvabel"
"somber"
"sommatie"
"soort"
"soppen"
"sopraan"
"soundbar"
"spanen"
"spawater"
"spijgat"
"spinaal"
"spionage"
"spiraal"
"spleet"
"splijt"
"spoed"
"sporen"
"spul"
"spuug"
"spuw"
"stalen"
"standaard"
"star"
"stefan"
"stencil"
"stijf"
"stil"
"stip"
"stopdas"
"stoten"
"stoven"
"straat"
"strobbe"
"strubbel"
"stucadoor"
"stuif"
"stukadoor"
"subhoofd"
"subregent"
"sudoku"
"sukade"
"sulfaat"
"surinaams"
"suus"
"syfilis"
"symboliek"
"sympathie"
"synagoge"
"synchroon"
"synergie"
"systeem"
"taanderij"
"tabak"
"tachtig"
"tackelen"
"taiwanees"
"talman"
"tamheid"
"tangaslip"
"taps"
"tarkan"
"tarwe"
"tasman"
"tatjana"
"taxameter"
"teil"
"teisman"
"telbaar"
"telco"
"telganger"
"telstar"
"tenant"
"tepel"
"terzet"
"testament"
"ticket"
"tiesinga"
"tijdelijk"
"tika"
"tiksel"
"tilleman"
"timbaal"
"tinsteen"
"tiplijn"
"tippelaar"
"tjirpen"
"toezeggen"
"tolbaas"
"tolgeld"
"tolhek"
"tolo"
"tolpoort"
"toltarief"
"tolvrij"
"tomaat"
"tondeuse"
"toog"
"tooi"
"toonbaar"
"toos"
"topclub"
"toppen"
"toptalent"
"topvrouw"
"toque"
"torment"
"tornado"
"tosti"
"totdat"
"toucheer"
"toulouse"
"tournedos"
"tout"
"trabant"
"tragedie"
"trailer"
"traject"
"traktaat"
"trauma"
"tray"
"trechter"
"tred"
"tref"
"treur"
"troebel"
"tros"
"trucage"
"truffel"
"tsaar"
"tucht"
"tuenter"
"tuitelig"
"tukje"
"tuktuk"
"tulp"
"tuma"
"tureluurs"
"twijfel"
"twitteren"
"tyfoon"
"typograaf"
"ugandees"
"uiachtig"
"uier"
"uisnipper"
"ultiem"
"unitair"
"uranium"
"urbaan"
"urendag"
"ursula"
"uurcirkel"
"uurglas"
"uzelf"
"vaat"
"vakantie"
"vakleraar"
"valbijl"
"valpartij"
"valreep"
"valuatie"
"vanmiddag"
"vanonder"
"varaan"
"varken"
"vaten"
"veenbes"
"veeteler"
"velgrem"
"vellekoop"
"velvet"
"veneberg"
"venlo"
"vent"
"venusberg"
"venw"
"veredeld"
"verf"
"verhaaf"
"vermaak"
"vernaaid"
"verraad"
"vers"
"veruit"
"verzaagd"
"vetachtig"
"vetlok"
"vetmesten"
"veto"
"vetrek"
"vetstaart"
"vetten"
"veurink"
"viaduct"
"vibrafoon"
"vicariaat"
"vieux"
"vieveen"
"vijfvoud"
"villa"
"vilt"
"vimmetje"
"vindbaar"
"vips"
"virtueel"
"visdieven"
"visee"
"visie"
"vlaag"
"vleugel"
"vmbo"
"vocht"
"voesenek"
"voicemail"
"voip"
"volg"
"vork"
"vorselaar"
"voyeur"
"vracht"
"vrekkig"
"vreten"
"vrije"
"vrozen"
"vrucht"
"vucht"
"vugt"
"vulkaan"
"vulmiddel"
"vulva"
"vuren"
"waas"
"wacht"
"wadvogel"
"wafel"
"waffel"
"walhalla"
"walnoot"
"walraven"
"wals"
"walvis"
"wandaad"
"wanen"
"wanmolen"
"want"
"warklomp"
"warm"
"wasachtig"
"wasteil"
"watt"
"webhandel"
"weblog"
"webpagina"
"webzine"
"wedereis"
"wedstrijd"
"weeda"
"weert"
"wegmaaien"
"wegscheer"
"wekelijks"
"wekken"
"wekroep"
"wektoon"
"weldaad"
"welwater"
"wendbaar"
"wenkbrauw"
"wens"
"wentelaar"
"wervel"
"wesseling"
"wetboek"
"wetmatig"
"whirlpool"
"wijbrands"
"wijdbeens"
"wijk"
"wijnbes"
"wijting"
"wild"
"wimpelen"
"wingebied"
"winplaats"
"winter"
"winzucht"
"wipstaart"
"wisgerhof"
"withaar"
"witmaker"
"wokkel"
"wolf"
"wonenden"
"woning"
"worden"
"worp"
"wortel"
"wrat"
"wrijf"
"wringen"
"yoghurt"
"ypsilon"
"zaaijer"
"zaak"
"zacharias"
"zakelijk"
"zakkam"
"zakwater"
"zalf"
"zalig"
"zaniken"
"zebracode"
"zeeblauw"
"zeef"
"zeegaand"
"zeeuw"
"zege"
"zegje"
"zeil"
"zesbaans"
"zesenhalf"
"zeskantig"
"zesmaal"
"zetbaas"
"zetpil"
"zeulen"
"ziezo"
"zigzag"
"zijaltaar"
"zijbeuk"
"zijlijn"
"zijmuur"
"zijn"
"zijwaarts"
"zijzelf"
"zilt"
"zimmerman"
"zinledig"
"zinnelijk"
"zionist"
"zitdag"
"zitruimte"
"zitzak"
"zoal"
"zodoende"
"zoekbots"
"zoem"
"zoiets"
"zojuist"
"zondaar"
"zotskap"
"zottebol"
"zucht"
"zuivel"
"zulk"
"zult"
"zuster"
"zuur"
"zweedijk"
"zwendel"
"zwepen"
"zwiep"
"zwijmel"
"zworen"))
| 43,881 | Common Lisp | .lisp | 1,633 | 8.933864 | 60 | 0.266854 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | ab5be403b486a7568327ed14469c7568a5ccf71c101c64a8b82a7004daf46d6f | 8,075 | [
-1
] |
8,076 | spanish.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/spanish.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :spanish
4
#("ábaco"
"abdomen"
"abeja"
"abierto"
"abogado"
"abono"
"aborto"
"abrazo"
"abrir"
"abuelo"
"abuso"
"acabar"
"academia"
"acceso"
"acción"
"aceite"
"acelga"
"acento"
"aceptar"
"ácido"
"aclarar"
"acné"
"acoger"
"acoso"
"activo"
"acto"
"actriz"
"actuar"
"acudir"
"acuerdo"
"acusar"
"adicto"
"admitir"
"adoptar"
"adorno"
"aduana"
"adulto"
"aéreo"
"afectar"
"afición"
"afinar"
"afirmar"
"ágil"
"agitar"
"agonía"
"agosto"
"agotar"
"agregar"
"agrio"
"agua"
"agudo"
"águila"
"aguja"
"ahogo"
"ahorro"
"aire"
"aislar"
"ajedrez"
"ajeno"
"ajuste"
"alacrán"
"alambre"
"alarma"
"alba"
"álbum"
"alcalde"
"aldea"
"alegre"
"alejar"
"alerta"
"aleta"
"alfiler"
"alga"
"algodón"
"aliado"
"aliento"
"alivio"
"alma"
"almeja"
"almíbar"
"altar"
"alteza"
"altivo"
"alto"
"altura"
"alumno"
"alzar"
"amable"
"amante"
"amapola"
"amargo"
"amasar"
"ámbar"
"ámbito"
"ameno"
"amigo"
"amistad"
"amor"
"amparo"
"amplio"
"ancho"
"anciano"
"ancla"
"andar"
"andén"
"anemia"
"ángulo"
"anillo"
"ánimo"
"anís"
"anotar"
"antena"
"antiguo"
"antojo"
"anual"
"anular"
"anuncio"
"añadir"
"añejo"
"año"
"apagar"
"aparato"
"apetito"
"apio"
"aplicar"
"apodo"
"aporte"
"apoyo"
"aprender"
"aprobar"
"apuesta"
"apuro"
"arado"
"araña"
"arar"
"árbitro"
"árbol"
"arbusto"
"archivo"
"arco"
"arder"
"ardilla"
"arduo"
"área"
"árido"
"aries"
"armonía"
"arnés"
"aroma"
"arpa"
"arpón"
"arreglo"
"arroz"
"arruga"
"arte"
"artista"
"asa"
"asado"
"asalto"
"ascenso"
"asegurar"
"aseo"
"asesor"
"asiento"
"asilo"
"asistir"
"asno"
"asombro"
"áspero"
"astilla"
"astro"
"astuto"
"asumir"
"asunto"
"atajo"
"ataque"
"atar"
"atento"
"ateo"
"ático"
"atleta"
"átomo"
"atraer"
"atroz"
"atún"
"audaz"
"audio"
"auge"
"aula"
"aumento"
"ausente"
"autor"
"aval"
"avance"
"avaro"
"ave"
"avellana"
"avena"
"avestruz"
"avión"
"aviso"
"ayer"
"ayuda"
"ayuno"
"azafrán"
"azar"
"azote"
"azúcar"
"azufre"
"azul"
"baba"
"babor"
"bache"
"bahía"
"baile"
"bajar"
"balanza"
"balcón"
"balde"
"bambú"
"banco"
"banda"
"baño"
"barba"
"barco"
"barniz"
"barro"
"báscula"
"bastón"
"basura"
"batalla"
"batería"
"batir"
"batuta"
"baúl"
"bazar"
"bebé"
"bebida"
"bello"
"besar"
"beso"
"bestia"
"bicho"
"bien"
"bingo"
"blanco"
"bloque"
"blusa"
"boa"
"bobina"
"bobo"
"boca"
"bocina"
"boda"
"bodega"
"boina"
"bola"
"bolero"
"bolsa"
"bomba"
"bondad"
"bonito"
"bono"
"bonsái"
"borde"
"borrar"
"bosque"
"bote"
"botín"
"bóveda"
"bozal"
"bravo"
"brazo"
"brecha"
"breve"
"brillo"
"brinco"
"brisa"
"broca"
"broma"
"bronce"
"brote"
"bruja"
"brusco"
"bruto"
"buceo"
"bucle"
"bueno"
"buey"
"bufanda"
"bufón"
"búho"
"buitre"
"bulto"
"burbuja"
"burla"
"burro"
"buscar"
"butaca"
"buzón"
"caballo"
"cabeza"
"cabina"
"cabra"
"cacao"
"cadáver"
"cadena"
"caer"
"café"
"caída"
"caimán"
"caja"
"cajón"
"cal"
"calamar"
"calcio"
"caldo"
"calidad"
"calle"
"calma"
"calor"
"calvo"
"cama"
"cambio"
"camello"
"camino"
"campo"
"cáncer"
"candil"
"canela"
"canguro"
"canica"
"canto"
"caña"
"cañón"
"caoba"
"caos"
"capaz"
"capitán"
"capote"
"captar"
"capucha"
"cara"
"carbón"
"cárcel"
"careta"
"carga"
"cariño"
"carne"
"carpeta"
"carro"
"carta"
"casa"
"casco"
"casero"
"caspa"
"castor"
"catorce"
"catre"
"caudal"
"causa"
"cazo"
"cebolla"
"ceder"
"cedro"
"celda"
"célebre"
"celoso"
"célula"
"cemento"
"ceniza"
"centro"
"cerca"
"cerdo"
"cereza"
"cero"
"cerrar"
"certeza"
"césped"
"cetro"
"chacal"
"chaleco"
"champú"
"chancla"
"chapa"
"charla"
"chico"
"chiste"
"chivo"
"choque"
"choza"
"chuleta"
"chupar"
"ciclón"
"ciego"
"cielo"
"cien"
"cierto"
"cifra"
"cigarro"
"cima"
"cinco"
"cine"
"cinta"
"ciprés"
"circo"
"ciruela"
"cisne"
"cita"
"ciudad"
"clamor"
"clan"
"claro"
"clase"
"clave"
"cliente"
"clima"
"clínica"
"cobre"
"cocción"
"cochino"
"cocina"
"coco"
"código"
"codo"
"cofre"
"coger"
"cohete"
"cojín"
"cojo"
"cola"
"colcha"
"colegio"
"colgar"
"colina"
"collar"
"colmo"
"columna"
"combate"
"comer"
"comida"
"cómodo"
"compra"
"conde"
"conejo"
"conga"
"conocer"
"consejo"
"contar"
"copa"
"copia"
"corazón"
"corbata"
"corcho"
"cordón"
"corona"
"correr"
"coser"
"cosmos"
"costa"
"cráneo"
"cráter"
"crear"
"crecer"
"creído"
"crema"
"cría"
"crimen"
"cripta"
"crisis"
"cromo"
"crónica"
"croqueta"
"crudo"
"cruz"
"cuadro"
"cuarto"
"cuatro"
"cubo"
"cubrir"
"cuchara"
"cuello"
"cuento"
"cuerda"
"cuesta"
"cueva"
"cuidar"
"culebra"
"culpa"
"culto"
"cumbre"
"cumplir"
"cuna"
"cuneta"
"cuota"
"cupón"
"cúpula"
"curar"
"curioso"
"curso"
"curva"
"cutis"
"dama"
"danza"
"dar"
"dardo"
"dátil"
"deber"
"débil"
"década"
"decir"
"dedo"
"defensa"
"definir"
"dejar"
"delfín"
"delgado"
"delito"
"demora"
"denso"
"dental"
"deporte"
"derecho"
"derrota"
"desayuno"
"deseo"
"desfile"
"desnudo"
"destino"
"desvío"
"detalle"
"detener"
"deuda"
"día"
"diablo"
"diadema"
"diamante"
"diana"
"diario"
"dibujo"
"dictar"
"diente"
"dieta"
"diez"
"difícil"
"digno"
"dilema"
"diluir"
"dinero"
"directo"
"dirigir"
"disco"
"diseño"
"disfraz"
"diva"
"divino"
"doble"
"doce"
"dolor"
"domingo"
"don"
"donar"
"dorado"
"dormir"
"dorso"
"dos"
"dosis"
"dragón"
"droga"
"ducha"
"duda"
"duelo"
"dueño"
"dulce"
"dúo"
"duque"
"durar"
"dureza"
"duro"
"ébano"
"ebrio"
"echar"
"eco"
"ecuador"
"edad"
"edición"
"edificio"
"editor"
"educar"
"efecto"
"eficaz"
"eje"
"ejemplo"
"elefante"
"elegir"
"elemento"
"elevar"
"elipse"
"élite"
"elixir"
"elogio"
"eludir"
"embudo"
"emitir"
"emoción"
"empate"
"empeño"
"empleo"
"empresa"
"enano"
"encargo"
"enchufe"
"encía"
"enemigo"
"enero"
"enfado"
"enfermo"
"engaño"
"enigma"
"enlace"
"enorme"
"enredo"
"ensayo"
"enseñar"
"entero"
"entrar"
"envase"
"envío"
"época"
"equipo"
"erizo"
"escala"
"escena"
"escolar"
"escribir"
"escudo"
"esencia"
"esfera"
"esfuerzo"
"espada"
"espejo"
"espía"
"esposa"
"espuma"
"esquí"
"estar"
"este"
"estilo"
"estufa"
"etapa"
"eterno"
"ética"
"etnia"
"evadir"
"evaluar"
"evento"
"evitar"
"exacto"
"examen"
"exceso"
"excusa"
"exento"
"exigir"
"exilio"
"existir"
"éxito"
"experto"
"explicar"
"exponer"
"extremo"
"fábrica"
"fábula"
"fachada"
"fácil"
"factor"
"faena"
"faja"
"falda"
"fallo"
"falso"
"faltar"
"fama"
"familia"
"famoso"
"faraón"
"farmacia"
"farol"
"farsa"
"fase"
"fatiga"
"fauna"
"favor"
"fax"
"febrero"
"fecha"
"feliz"
"feo"
"feria"
"feroz"
"fértil"
"fervor"
"festín"
"fiable"
"fianza"
"fiar"
"fibra"
"ficción"
"ficha"
"fideo"
"fiebre"
"fiel"
"fiera"
"fiesta"
"figura"
"fijar"
"fijo"
"fila"
"filete"
"filial"
"filtro"
"fin"
"finca"
"fingir"
"finito"
"firma"
"flaco"
"flauta"
"flecha"
"flor"
"flota"
"fluir"
"flujo"
"flúor"
"fobia"
"foca"
"fogata"
"fogón"
"folio"
"folleto"
"fondo"
"forma"
"forro"
"fortuna"
"forzar"
"fosa"
"foto"
"fracaso"
"frágil"
"franja"
"frase"
"fraude"
"freír"
"freno"
"fresa"
"frío"
"frito"
"fruta"
"fuego"
"fuente"
"fuerza"
"fuga"
"fumar"
"función"
"funda"
"furgón"
"furia"
"fusil"
"fútbol"
"futuro"
"gacela"
"gafas"
"gaita"
"gajo"
"gala"
"galería"
"gallo"
"gamba"
"ganar"
"gancho"
"ganga"
"ganso"
"garaje"
"garza"
"gasolina"
"gastar"
"gato"
"gavilán"
"gemelo"
"gemir"
"gen"
"género"
"genio"
"gente"
"geranio"
"gerente"
"germen"
"gesto"
"gigante"
"gimnasio"
"girar"
"giro"
"glaciar"
"globo"
"gloria"
"gol"
"golfo"
"goloso"
"golpe"
"goma"
"gordo"
"gorila"
"gorra"
"gota"
"goteo"
"gozar"
"grada"
"gráfico"
"grano"
"grasa"
"gratis"
"grave"
"grieta"
"grillo"
"gripe"
"gris"
"grito"
"grosor"
"grúa"
"grueso"
"grumo"
"grupo"
"guante"
"guapo"
"guardia"
"guerra"
"guía"
"guiño"
"guion"
"guiso"
"guitarra"
"gusano"
"gustar"
"haber"
"hábil"
"hablar"
"hacer"
"hacha"
"hada"
"hallar"
"hamaca"
"harina"
"haz"
"hazaña"
"hebilla"
"hebra"
"hecho"
"helado"
"helio"
"hembra"
"herir"
"hermano"
"héroe"
"hervir"
"hielo"
"hierro"
"hígado"
"higiene"
"hijo"
"himno"
"historia"
"hocico"
"hogar"
"hoguera"
"hoja"
"hombre"
"hongo"
"honor"
"honra"
"hora"
"hormiga"
"horno"
"hostil"
"hoyo"
"hueco"
"huelga"
"huerta"
"hueso"
"huevo"
"huida"
"huir"
"humano"
"húmedo"
"humilde"
"humo"
"hundir"
"huracán"
"hurto"
"icono"
"ideal"
"idioma"
"ídolo"
"iglesia"
"iglú"
"igual"
"ilegal"
"ilusión"
"imagen"
"imán"
"imitar"
"impar"
"imperio"
"imponer"
"impulso"
"incapaz"
"índice"
"inerte"
"infiel"
"informe"
"ingenio"
"inicio"
"inmenso"
"inmune"
"innato"
"insecto"
"instante"
"interés"
"íntimo"
"intuir"
"inútil"
"invierno"
"ira"
"iris"
"ironía"
"isla"
"islote"
"jabalí"
"jabón"
"jamón"
"jarabe"
"jardín"
"jarra"
"jaula"
"jazmín"
"jefe"
"jeringa"
"jinete"
"jornada"
"joroba"
"joven"
"joya"
"juerga"
"jueves"
"juez"
"jugador"
"jugo"
"juguete"
"juicio"
"junco"
"jungla"
"junio"
"juntar"
"júpiter"
"jurar"
"justo"
"juvenil"
"juzgar"
"kilo"
"koala"
"labio"
"lacio"
"lacra"
"lado"
"ladrón"
"lagarto"
"lágrima"
"laguna"
"laico"
"lamer"
"lámina"
"lámpara"
"lana"
"lancha"
"langosta"
"lanza"
"lápiz"
"largo"
"larva"
"lástima"
"lata"
"látex"
"latir"
"laurel"
"lavar"
"lazo"
"leal"
"lección"
"leche"
"lector"
"leer"
"legión"
"legumbre"
"lejano"
"lengua"
"lento"
"leña"
"león"
"leopardo"
"lesión"
"letal"
"letra"
"leve"
"leyenda"
"libertad"
"libro"
"licor"
"líder"
"lidiar"
"lienzo"
"liga"
"ligero"
"lima"
"límite"
"limón"
"limpio"
"lince"
"lindo"
"línea"
"lingote"
"lino"
"linterna"
"líquido"
"liso"
"lista"
"litera"
"litio"
"litro"
"llaga"
"llama"
"llanto"
"llave"
"llegar"
"llenar"
"llevar"
"llorar"
"llover"
"lluvia"
"lobo"
"loción"
"loco"
"locura"
"lógica"
"logro"
"lombriz"
"lomo"
"lonja"
"lote"
"lucha"
"lucir"
"lugar"
"lujo"
"luna"
"lunes"
"lupa"
"lustro"
"luto"
"luz"
"maceta"
"macho"
"madera"
"madre"
"maduro"
"maestro"
"mafia"
"magia"
"mago"
"maíz"
"maldad"
"maleta"
"malla"
"malo"
"mamá"
"mambo"
"mamut"
"manco"
"mando"
"manejar"
"manga"
"maniquí"
"manjar"
"mano"
"manso"
"manta"
"mañana"
"mapa"
"máquina"
"mar"
"marco"
"marea"
"marfil"
"margen"
"marido"
"mármol"
"marrón"
"martes"
"marzo"
"masa"
"máscara"
"masivo"
"matar"
"materia"
"matiz"
"matriz"
"máximo"
"mayor"
"mazorca"
"mecha"
"medalla"
"medio"
"médula"
"mejilla"
"mejor"
"melena"
"melón"
"memoria"
"menor"
"mensaje"
"mente"
"menú"
"mercado"
"merengue"
"mérito"
"mes"
"mesón"
"meta"
"meter"
"método"
"metro"
"mezcla"
"miedo"
"miel"
"miembro"
"miga"
"mil"
"milagro"
"militar"
"millón"
"mimo"
"mina"
"minero"
"mínimo"
"minuto"
"miope"
"mirar"
"misa"
"miseria"
"misil"
"mismo"
"mitad"
"mito"
"mochila"
"moción"
"moda"
"modelo"
"moho"
"mojar"
"molde"
"moler"
"molino"
"momento"
"momia"
"monarca"
"moneda"
"monja"
"monto"
"moño"
"morada"
"morder"
"moreno"
"morir"
"morro"
"morsa"
"mortal"
"mosca"
"mostrar"
"motivo"
"mover"
"móvil"
"mozo"
"mucho"
"mudar"
"mueble"
"muela"
"muerte"
"muestra"
"mugre"
"mujer"
"mula"
"muleta"
"multa"
"mundo"
"muñeca"
"mural"
"muro"
"músculo"
"museo"
"musgo"
"música"
"muslo"
"nácar"
"nación"
"nadar"
"naipe"
"naranja"
"nariz"
"narrar"
"nasal"
"natal"
"nativo"
"natural"
"náusea"
"naval"
"nave"
"navidad"
"necio"
"néctar"
"negar"
"negocio"
"negro"
"neón"
"nervio"
"neto"
"neutro"
"nevar"
"nevera"
"nicho"
"nido"
"niebla"
"nieto"
"niñez"
"niño"
"nítido"
"nivel"
"nobleza"
"noche"
"nómina"
"noria"
"norma"
"norte"
"nota"
"noticia"
"novato"
"novela"
"novio"
"nube"
"nuca"
"núcleo"
"nudillo"
"nudo"
"nuera"
"nueve"
"nuez"
"nulo"
"número"
"nutria"
"oasis"
"obeso"
"obispo"
"objeto"
"obra"
"obrero"
"observar"
"obtener"
"obvio"
"oca"
"ocaso"
"océano"
"ochenta"
"ocho"
"ocio"
"ocre"
"octavo"
"octubre"
"oculto"
"ocupar"
"ocurrir"
"odiar"
"odio"
"odisea"
"oeste"
"ofensa"
"oferta"
"oficio"
"ofrecer"
"ogro"
"oído"
"oír"
"ojo"
"ola"
"oleada"
"olfato"
"olivo"
"olla"
"olmo"
"olor"
"olvido"
"ombligo"
"onda"
"onza"
"opaco"
"opción"
"ópera"
"opinar"
"oponer"
"optar"
"óptica"
"opuesto"
"oración"
"orador"
"oral"
"órbita"
"orca"
"orden"
"oreja"
"órgano"
"orgía"
"orgullo"
"oriente"
"origen"
"orilla"
"oro"
"orquesta"
"oruga"
"osadía"
"oscuro"
"osezno"
"oso"
"ostra"
"otoño"
"otro"
"oveja"
"óvulo"
"óxido"
"oxígeno"
"oyente"
"ozono"
"pacto"
"padre"
"paella"
"página"
"pago"
"país"
"pájaro"
"palabra"
"palco"
"paleta"
"pálido"
"palma"
"paloma"
"palpar"
"pan"
"panal"
"pánico"
"pantera"
"pañuelo"
"papá"
"papel"
"papilla"
"paquete"
"parar"
"parcela"
"pared"
"parir"
"paro"
"párpado"
"parque"
"párrafo"
"parte"
"pasar"
"paseo"
"pasión"
"paso"
"pasta"
"pata"
"patio"
"patria"
"pausa"
"pauta"
"pavo"
"payaso"
"peatón"
"pecado"
"pecera"
"pecho"
"pedal"
"pedir"
"pegar"
"peine"
"pelar"
"peldaño"
"pelea"
"peligro"
"pellejo"
"pelo"
"peluca"
"pena"
"pensar"
"peñón"
"peón"
"peor"
"pepino"
"pequeño"
"pera"
"percha"
"perder"
"pereza"
"perfil"
"perico"
"perla"
"permiso"
"perro"
"persona"
"pesa"
"pesca"
"pésimo"
"pestaña"
"pétalo"
"petróleo"
"pez"
"pezuña"
"picar"
"pichón"
"pie"
"piedra"
"pierna"
"pieza"
"pijama"
"pilar"
"piloto"
"pimienta"
"pino"
"pintor"
"pinza"
"piña"
"piojo"
"pipa"
"pirata"
"pisar"
"piscina"
"piso"
"pista"
"pitón"
"pizca"
"placa"
"plan"
"plata"
"playa"
"plaza"
"pleito"
"pleno"
"plomo"
"pluma"
"plural"
"pobre"
"poco"
"poder"
"podio"
"poema"
"poesía"
"poeta"
"polen"
"policía"
"pollo"
"polvo"
"pomada"
"pomelo"
"pomo"
"pompa"
"poner"
"porción"
"portal"
"posada"
"poseer"
"posible"
"poste"
"potencia"
"potro"
"pozo"
"prado"
"precoz"
"pregunta"
"premio"
"prensa"
"preso"
"previo"
"primo"
"príncipe"
"prisión"
"privar"
"proa"
"probar"
"proceso"
"producto"
"proeza"
"profesor"
"programa"
"prole"
"promesa"
"pronto"
"propio"
"próximo"
"prueba"
"público"
"puchero"
"pudor"
"pueblo"
"puerta"
"puesto"
"pulga"
"pulir"
"pulmón"
"pulpo"
"pulso"
"puma"
"punto"
"puñal"
"puño"
"pupa"
"pupila"
"puré"
"quedar"
"queja"
"quemar"
"querer"
"queso"
"quieto"
"química"
"quince"
"quitar"
"rábano"
"rabia"
"rabo"
"ración"
"radical"
"raíz"
"rama"
"rampa"
"rancho"
"rango"
"rapaz"
"rápido"
"rapto"
"rasgo"
"raspa"
"rato"
"rayo"
"raza"
"razón"
"reacción"
"realidad"
"rebaño"
"rebote"
"recaer"
"receta"
"rechazo"
"recoger"
"recreo"
"recto"
"recurso"
"red"
"redondo"
"reducir"
"reflejo"
"reforma"
"refrán"
"refugio"
"regalo"
"regir"
"regla"
"regreso"
"rehén"
"reino"
"reír"
"reja"
"relato"
"relevo"
"relieve"
"relleno"
"reloj"
"remar"
"remedio"
"remo"
"rencor"
"rendir"
"renta"
"reparto"
"repetir"
"reposo"
"reptil"
"res"
"rescate"
"resina"
"respeto"
"resto"
"resumen"
"retiro"
"retorno"
"retrato"
"reunir"
"revés"
"revista"
"rey"
"rezar"
"rico"
"riego"
"rienda"
"riesgo"
"rifa"
"rígido"
"rigor"
"rincón"
"riñón"
"río"
"riqueza"
"risa"
"ritmo"
"rito"))
| 42,061 | Common Lisp | .lisp | 1,633 | 7.652174 | 60 | 0.228637 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 4c23b912eb2065a3a5d46154653a6f7dd42d128130c312b0030328abc84bb2c1 | 8,076 | [
-1
] |
8,077 | french.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/french.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :french
4
#("abandon"
"abattre"
"aboi"
"abolir"
"aborder"
"abri"
"absence"
"absolu"
"abuser"
"acacia"
"acajou"
"accent"
"accord"
"accrocher"
"accuser"
"acerbe"
"achat"
"acheter"
"acide"
"acier"
"acquis"
"acte"
"action"
"adage"
"adepte"
"adieu"
"admettre"
"admis"
"adorer"
"adresser"
"aduler"
"affaire"
"affirmer"
"afin"
"agacer"
"agent"
"agir"
"agiter"
"agonie"
"agrafe"
"agrume"
"aider"
"aigle"
"aigre"
"aile"
"ailleurs"
"aimant"
"aimer"
"ainsi"
"aise"
"ajouter"
"alarme"
"album"
"alcool"
"alerte"
"algue"
"alibi"
"aller"
"allumer"
"alors"
"amande"
"amener"
"amie"
"amorcer"
"amour"
"ample"
"amuser"
"ananas"
"ancien"
"anglais"
"angoisse"
"animal"
"anneau"
"annoncer"
"apercevoir"
"apparence"
"appel"
"apporter"
"apprendre"
"appuyer"
"arbre"
"arcade"
"arceau"
"arche"
"ardeur"
"argent"
"argile"
"aride"
"arme"
"armure"
"arracher"
"arriver"
"article"
"asile"
"aspect"
"assaut"
"assez"
"assister"
"assurer"
"astre"
"astuce"
"atlas"
"atroce"
"attacher"
"attente"
"attirer"
"aube"
"aucun"
"audace"
"auparavant"
"auquel"
"aurore"
"aussi"
"autant"
"auteur"
"autoroute"
"autre"
"aval"
"avant"
"avec"
"avenir"
"averse"
"aveu"
"avide"
"avion"
"avis"
"avoir"
"avouer"
"avril"
"azote"
"azur"
"badge"
"bagage"
"bague"
"bain"
"baisser"
"balai"
"balcon"
"balise"
"balle"
"bambou"
"banane"
"banc"
"bandage"
"banjo"
"banlieue"
"bannir"
"banque"
"baobab"
"barbe"
"barque"
"barrer"
"bassine"
"bataille"
"bateau"
"battre"
"baver"
"bavoir"
"bazar"
"beau"
"beige"
"berger"
"besoin"
"beurre"
"biais"
"biceps"
"bidule"
"bien"
"bijou"
"bilan"
"billet"
"blanc"
"blason"
"bleu"
"bloc"
"blond"
"bocal"
"boire"
"boiserie"
"boiter"
"bonbon"
"bondir"
"bonheur"
"bordure"
"borgne"
"borner"
"bosse"
"bouche"
"bouder"
"bouger"
"boule"
"bourse"
"bout"
"boxe"
"brader"
"braise"
"branche"
"braquer"
"bras"
"brave"
"brebis"
"brevet"
"brider"
"briller"
"brin"
"brique"
"briser"
"broche"
"broder"
"bronze"
"brosser"
"brouter"
"bruit"
"brute"
"budget"
"buffet"
"bulle"
"bureau"
"buriner"
"buste"
"buter"
"butiner"
"cabas"
"cabinet"
"cabri"
"cacao"
"cacher"
"cadeau"
"cadre"
"cage"
"caisse"
"caler"
"calme"
"camarade"
"camion"
"campagne"
"canal"
"canif"
"capable"
"capot"
"carat"
"caresser"
"carie"
"carpe"
"cartel"
"casier"
"casque"
"casserole"
"cause"
"cavale"
"cave"
"ceci"
"cela"
"celui"
"cendre"
"cent"
"cependant"
"cercle"
"cerise"
"cerner"
"certes"
"cerveau"
"cesser"
"chacun"
"chair"
"chaleur"
"chamois"
"chanson"
"chaque"
"charge"
"chasse"
"chat"
"chaud"
"chef"
"chemin"
"cheveu"
"chez"
"chicane"
"chien"
"chiffre"
"chiner"
"chiot"
"chlore"
"choc"
"choix"
"chose"
"chou"
"chute"
"cibler"
"cidre"
"ciel"
"cigale"
"cinq"
"cintre"
"cirage"
"cirque"
"ciseau"
"citation"
"citer"
"citron"
"civet"
"clairon"
"clan"
"classe"
"clavier"
"clef"
"climat"
"cloche"
"cloner"
"clore"
"clos"
"clou"
"club"
"cobra"
"cocon"
"coiffer"
"coin"
"colline"
"colon"
"combat"
"comme"
"compte"
"conclure"
"conduire"
"confier"
"connu"
"conseil"
"contre"
"convenir"
"copier"
"cordial"
"cornet"
"corps"
"cosmos"
"coton"
"couche"
"coude"
"couler"
"coupure"
"cour"
"couteau"
"couvrir"
"crabe"
"crainte"
"crampe"
"cran"
"creuser"
"crever"
"crier"
"crime"
"crin"
"crise"
"crochet"
"croix"
"cruel"
"cuisine"
"cuite"
"culot"
"culte"
"cumul"
"cure"
"curieux"
"cuve"
"dame"
"danger"
"dans"
"davantage"
"debout"
"dedans"
"dehors"
"delta"
"demain"
"demeurer"
"demi"
"dense"
"dent"
"depuis"
"dernier"
"descendre"
"dessus"
"destin"
"dette"
"deuil"
"deux"
"devant"
"devenir"
"devin"
"devoir"
"dicton"
"dieu"
"difficile"
"digestion"
"digue"
"diluer"
"dimanche"
"dinde"
"diode"
"dire"
"diriger"
"discours"
"disposer"
"distance"
"divan"
"divers"
"docile"
"docteur"
"dodu"
"dogme"
"doigt"
"dominer"
"donation"
"donjon"
"donner"
"dopage"
"dorer"
"dormir"
"doseur"
"douane"
"double"
"douche"
"douleur"
"doute"
"doux"
"douzaine"
"draguer"
"drame"
"drap"
"dresser"
"droit"
"duel"
"dune"
"duper"
"durant"
"durcir"
"durer"
"eaux"
"effacer"
"effet"
"effort"
"effrayant"
"elle"
"embrasser"
"emmener"
"emparer"
"empire"
"employer"
"emporter"
"enclos"
"encore"
"endive"
"endormir"
"endroit"
"enduit"
"enfant"
"enfermer"
"enfin"
"enfler"
"enfoncer"
"enfuir"
"engager"
"engin"
"enjeu"
"enlever"
"ennemi"
"ennui"
"ensemble"
"ensuite"
"entamer"
"entendre"
"entier"
"entourer"
"entre"
"envelopper"
"envie"
"envoyer"
"erreur"
"escalier"
"espace"
"espoir"
"esprit"
"essai"
"essor"
"essuyer"
"estimer"
"exact"
"examiner"
"excuse"
"exemple"
"exiger"
"exil"
"exister"
"exode"
"expliquer"
"exposer"
"exprimer"
"extase"
"fable"
"facette"
"facile"
"fade"
"faible"
"faim"
"faire"
"fait"
"falloir"
"famille"
"faner"
"farce"
"farine"
"fatigue"
"faucon"
"faune"
"faute"
"faux"
"faveur"
"favori"
"faxer"
"feinter"
"femme"
"fendre"
"fente"
"ferme"
"festin"
"feuille"
"feutre"
"fiable"
"fibre"
"ficher"
"fier"
"figer"
"figure"
"filet"
"fille"
"filmer"
"fils"
"filtre"
"final"
"finesse"
"finir"
"fiole"
"firme"
"fixe"
"flacon"
"flair"
"flamme"
"flan"
"flaque"
"fleur"
"flocon"
"flore"
"flot"
"flou"
"fluide"
"fluor"
"flux"
"focus"
"foin"
"foire"
"foison"
"folie"
"fonction"
"fondre"
"fonte"
"force"
"forer"
"forger"
"forme"
"fort"
"fosse"
"fouet"
"fouine"
"foule"
"four"
"foyer"
"frais"
"franc"
"frapper"
"freiner"
"frimer"
"friser"
"frite"
"froid"
"froncer"
"fruit"
"fugue"
"fuir"
"fuite"
"fumer"
"fureur"
"furieux"
"fuser"
"fusil"
"futile"
"futur"
"gagner"
"gain"
"gala"
"galet"
"galop"
"gamme"
"gant"
"garage"
"garde"
"garer"
"gauche"
"gaufre"
"gaule"
"gaver"
"gazon"
"geler"
"genou"
"genre"
"gens"
"gercer"
"germer"
"geste"
"gibier"
"gicler"
"gilet"
"girafe"
"givre"
"glace"
"glisser"
"globe"
"gloire"
"gluant"
"gober"
"golf"
"gommer"
"gorge"
"gosier"
"goutte"
"grain"
"gramme"
"grand"
"gras"
"grave"
"gredin"
"griffure"
"griller"
"gris"
"gronder"
"gros"
"grotte"
"groupe"
"grue"
"guerrier"
"guetter"
"guider"
"guise"
"habiter"
"hache"
"haie"
"haine"
"halte"
"hamac"
"hanche"
"hangar"
"hanter"
"haras"
"hareng"
"harpe"
"hasard"
"hausse"
"haut"
"havre"
"herbe"
"heure"
"hibou"
"hier"
"histoire"
"hiver"
"hochet"
"homme"
"honneur"
"honte"
"horde"
"horizon"
"hormone"
"houle"
"housse"
"hublot"
"huile"
"huit"
"humain"
"humble"
"humide"
"humour"
"hurler"
"idole"
"igloo"
"ignorer"
"illusion"
"image"
"immense"
"immobile"
"imposer"
"impression"
"incapable"
"inconnu"
"index"
"indiquer"
"infime"
"injure"
"inox"
"inspirer"
"instant"
"intention"
"intime"
"inutile"
"inventer"
"inviter"
"iode"
"iris"
"issue"
"ivre"
"jade"
"jadis"
"jamais"
"jambe"
"janvier"
"jardin"
"jauge"
"jaunisse"
"jeter"
"jeton"
"jeudi"
"jeune"
"joie"
"joindre"
"joli"
"joueur"
"journal"
"judo"
"juge"
"juillet"
"juin"
"jument"
"jungle"
"jupe"
"jupon"
"jurer"
"juron"
"jury"
"jusque"
"juste"
"kayak"
"ketchup"
"kilo"
"kiwi"
"koala"
"label"
"lacet"
"lacune"
"laine"
"laisse"
"lait"
"lame"
"lancer"
"lande"
"laque"
"lard"
"largeur"
"larme"
"larve"
"lasso"
"laver"
"lendemain"
"lentement"
"lequel"
"lettre"
"leur"
"lever"
"levure"
"liane"
"libre"
"lien"
"lier"
"lieutenant"
"ligne"
"ligoter"
"liguer"
"limace"
"limer"
"limite"
"lingot"
"lion"
"lire"
"lisser"
"litre"
"livre"
"lobe"
"local"
"logis"
"loin"
"loisir"
"long"
"loque"
"lors"
"lotus"
"louer"
"loup"
"lourd"
"louve"
"loyer"
"lubie"
"lucide"
"lueur"
"luge"
"luire"
"lundi"
"lune"
"lustre"
"lutin"
"lutte"
"luxe"
"machine"
"madame"
"magie"
"magnifique"
"magot"
"maigre"
"main"
"mairie"
"maison"
"malade"
"malheur"
"malin"
"manche"
"manger"
"manier"
"manoir"
"manquer"
"marche"
"mardi"
"marge"
"mariage"
"marquer"
"mars"
"masque"
"masse"
"matin"
"mauvais"
"meilleur"
"melon"
"membre"
"menacer"
"mener"
"mensonge"
"mentir"
"menu"
"merci"
"merlu"
"mesure"
"mettre"
"meuble"
"meunier"
"meute"
"miche"
"micro"
"midi"
"miel"
"miette"
"mieux"
"milieu"
"mille"
"mimer"
"mince"
"mineur"
"ministre"
"minute"
"mirage"
"miroir"
"miser"
"mite"
"mixte"
"mobile"
"mode"
"module"
"moins"
"mois"
"moment"
"momie"
"monde"
"monsieur"
"monter"
"moquer"
"moral"
"morceau"
"mordre"
"morose"
"morse"
"mortier"
"morue"
"motif"
"motte"
"moudre"
"moule"
"mourir"
"mousse"
"mouton"
"mouvement"
"moyen"
"muer"
"muette"
"mugir"
"muguet"
"mulot"
"multiple"
"munir"
"muret"
"muse"
"musique"
"muter"
"nacre"
"nager"
"nain"
"naissance"
"narine"
"narrer"
"naseau"
"nasse"
"nation"
"nature"
"naval"
"navet"
"naviguer"
"navrer"
"neige"
"nerf"
"nerveux"
"neuf"
"neutre"
"neuve"
"neveu"
"niche"
"nier"
"niveau"
"noble"
"noce"
"nocif"
"noir"
"nomade"
"nombre"
"nommer"
"nord"
"norme"
"notaire"
"notice"
"notre"
"nouer"
"nougat"
"nourrir"
"nous"
"nouveau"
"novice"
"noyade"
"noyer"
"nuage"
"nuance"
"nuire"
"nuit"
"nulle"
"nuque"
"oasis"
"objet"
"obliger"
"obscur"
"observer"
"obtenir"
"obus"
"occasion"
"occuper"
"ocre"
"octet"
"odeur"
"odorat"
"offense"
"officier"
"offrir"
"ogive"
"oiseau"
"olive"
"ombre"
"onctueux"
"onduler"
"ongle"
"onze"
"opter"
"option"
"orageux"
"oral"
"orange"
"orbite"
"ordinaire"
"ordre"
"oreille"
"organe"
"orgie"
"orgueil"
"orient"
"origan"
"orner"
"orteil"
"ortie"
"oser"
"osselet"
"otage"
"otarie"
"ouate"
"oublier"
"ouest"
"ours"
"outil"
"outre"
"ouvert"
"ouvrir"
"ovale"
"ozone"
"pacte"
"page"
"paille"
"pain"
"paire"
"paix"
"palace"
"palissade"
"palmier"
"palpiter"
"panda"
"panneau"
"papa"
"papier"
"paquet"
"parc"
"pardi"
"parfois"
"parler"
"parmi"
"parole"
"partir"
"parvenir"
"passer"
"pastel"
"patin"
"patron"
"paume"
"pause"
"pauvre"
"paver"
"pavot"
"payer"
"pays"
"peau"
"peigne"
"peinture"
"pelage"
"pelote"
"pencher"
"pendre"
"penser"
"pente"
"percer"
"perdu"
"perle"
"permettre"
"personne"
"perte"
"peser"
"pesticide"
"petit"
"peuple"
"peur"
"phase"
"photo"
"phrase"
"piano"
"pied"
"pierre"
"pieu"
"pile"
"pilier"
"pilote"
"pilule"
"piment"
"pincer"
"pinson"
"pinte"
"pion"
"piquer"
"pirate"
"pire"
"piste"
"piton"
"pitre"
"pivot"
"pizza"
"placer"
"plage"
"plaire"
"plan"
"plaque"
"plat"
"plein"
"pleurer"
"pliage"
"plier"
"plonger"
"plot"
"pluie"
"plume"
"plus"
"pneu"
"poche"
"podium"
"poids"
"poil"
"point"
"poire"
"poison"
"poitrine"
"poivre"
"police"
"pollen"
"pomme"
"pompier"
"poncer"
"pondre"
"pont"
"portion"
"poser"
"position"
"possible"
"poste"
"potage"
"potin"
"pouce"
"poudre"
"poulet"
"poumon"
"poupe"
"pour"
"pousser"
"poutre"
"pouvoir"
"prairie"
"premier"
"prendre"
"presque"
"preuve"
"prier"
"primeur"
"prince"
"prison"
"priver"
"prix"
"prochain"
"produire"
"profond"
"proie"
"projet"
"promener"
"prononcer"
"propre"
"prose"
"prouver"
"prune"
"public"
"puce"
"pudeur"
"puiser"
"pull"
"pulpe"
"puma"
"punir"
"purge"
"putois"
"quand"
"quartier"
"quasi"
"quatre"
"quel"
"question"
"queue"
"quiche"
"quille"
"quinze"
"quitter"
"quoi"
"rabais"
"raboter"
"race"
"racheter"
"racine"
"racler"
"raconter"
"radar"
"radio"
"rafale"
"rage"
"ragot"
"raideur"
"raie"
"rail"
"raison"
"ramasser"
"ramener"
"rampe"
"rance"
"rang"
"rapace"
"rapide"
"rapport"
"rarement"
"rasage"
"raser"
"rasoir"
"rassurer"
"rater"
"ratio"
"rature"
"ravage"
"ravir"
"rayer"
"rayon"
"rebond"
"recevoir"
"recherche"
"record"
"reculer"
"redevenir"
"refuser"
"regard"
"regretter"
"rein"
"rejeter"
"rejoindre"
"relation"
"relever"
"religion"
"remarquer"
"remettre"
"remise"
"remonter"
"remplir"
"remuer"
"rencontre"
"rendre"
"renier"
"renoncer"
"rentrer"
"renverser"
"repas"
"repli"
"reposer"
"reproche"
"requin"
"respect"
"ressembler"
"reste"
"retard"
"retenir"
"retirer"
"retour"
"retrouver"
"revenir"
"revoir"
"revue"
"rhume"
"ricaner"
"riche"
"rideau"
"ridicule"
"rien"
"rigide"
"rincer"
"rire"
"risquer"
"rituel"
"rivage"
"rive"
"robe"
"robot"
"robuste"
"rocade"
"roche"
"rodeur"
"rogner"
"roman"
"rompre"
"ronce"
"rondeur"
"ronger"
"roque"
"rose"
"rosir"
"rotation"
"rotule"
"roue"
"rouge"
"rouler"
"route"
"ruban"
"rubis"
"ruche"
"rude"
"ruelle"
"ruer"
"rugby"
"rugir"
"ruine"
"rumeur"
"rural"
"ruse"
"rustre"
"sable"
"sabot"
"sabre"
"sacre"
"sage"
"saint"
"saisir"
"salade"
"salive"
"salle"
"salon"
"salto"
"salut"
"salve"
"samba"
"sandale"
"sanguin"
"sapin"
"sarcasme"
"satisfaire"
"sauce"
"sauf"
"sauge"
"saule"
"sauna"
"sauter"
"sauver"
"savoir"
"science"
"scoop"
"score"
"second"
"secret"
"secte"
"seigneur"
"sein"
"seize"
"selle"
"selon"
"semaine"
"sembler"
"semer"
"semis"
"sensuel"
"sentir"
"sept"
"serpe"
"serrer"
"sertir"
"service"
"seuil"
"seulement"
"short"
"sien"
"sigle"
"signal"
"silence"
"silo"
"simple"
"singe"
"sinon"
"sinus"
"sioux"
"sirop"
"site"
"situation"
"skier"
"snob"
"sobre"
"social"
"socle"
"sodium"
"soigner"
"soir"
"soixante"
"soja"
"solaire"
"soldat"
"soleil"
"solide"
"solo"
"solvant"
"sombre"
"somme"
"somnoler"
"sondage"
"songeur"
"sonner"
"sorte"
"sosie"
"sottise"
"souci"
"soudain"
"souffrir"
"souhaiter"
"soulever"
"soumettre"
"soupe"
"sourd"
"soustraire"
"soutenir"
"souvent"
"soyeux"
"spectacle"
"sport"
"stade"
"stagiaire"
"stand"
"star"
"statue"
"stock"
"stop"
"store"
"style"
"suave"
"subir"
"sucre"
"suer"
"suffire"
"suie"
"suite"
"suivre"
"sujet"
"sulfite"
"supposer"
"surf"
"surprendre"
"surtout"
"surveiller"
"tabac"
"table"
"tabou"
"tache"
"tacler"
"tacot"
"tact"
"taie"
"taille"
"taire"
"talon"
"talus"
"tandis"
"tango"
"tanin"
"tant"
"taper"
"tapis"
"tard"
"tarif"
"tarot"
"tarte"
"tasse"
"taureau"
"taux"
"taverne"
"taxer"
"taxi"
"tellement"
"temple"
"tendre"
"tenir"
"tenter"
"tenu"
"terme"
"ternir"
"terre"
"test"
"texte"
"thym"
"tibia"
"tiers"
"tige"
"tipi"
"tique"
"tirer"
"tissu"
"titre"
"toast"
"toge"
"toile"
"toiser"
"toiture"
"tomber"
"tome"
"tonne"
"tonte"
"toque"
"torse"
"tortue"
"totem"
"toucher"
"toujours"
"tour"
"tousser"
"tout"
"toux"
"trace"
"train"
"trame"
"tranquille"
"travail"
"trembler"
"trente"
"tribu"
"trier"
"trio"
"tripe"
"triste"
"troc"
"trois"
"tromper"
"tronc"
"trop"
"trotter"
"trouer"
"truc"
"truite"
"tuba"
"tuer"
"tuile"
"turbo"
"tutu"
"tuyau"
"type"
"union"
"unique"
"unir"
"unisson"
"untel"
"urne"
"usage"
"user"
"usiner"
"usure"
"utile"
"vache"
"vague"
"vaincre"
"valeur"
"valoir"
"valser"
"valve"
"vampire"
"vaseux"
"vaste"
"veau"
"veille"
"veine"
"velours"
"velu"
"vendre"
"venir"
"vent"
"venue"
"verbe"
"verdict"
"version"
"vertige"
"verve"
"veste"
"veto"
"vexer"
"vice"
"victime"
"vide"
"vieil"
"vieux"
"vigie"
"vigne"
"ville"
"vingt"
"violent"
"virer"
"virus"
"visage"
"viser"
"visite"
"visuel"
"vitamine"
"vitrine"
"vivant"
"vivre"
"vocal"
"vodka"
"vogue"
"voici"
"voile"
"voir"
"voisin"
"voiture"
"volaille"
"volcan"
"voler"
"volt"
"votant"
"votre"
"vouer"
"vouloir"
"vous"
"voyage"
"voyou"
"vrac"
"vrai"
"yacht"
"yeti"
"yeux"
"yoga"
"zeste"
"zinc"
"zone"
"zoom"))
| 42,060 | Common Lisp | .lisp | 1,633 | 7.818739 | 60 | 0.233827 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 0d2b6970e89474ac55fb914618e37106960d33d3597f3b45ab93f6961d8627d0 | 8,077 | [
-1
] |
8,078 | mnemonic.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/mnemonic.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defconstant +secret-key-length+ 32)
(defconstant +seed-length+ 24)
(defparameter *word-lists* (make-hash-table))
(defclass word-list ()
((language :initarg :language :reader language)
(prefix-length :initarg :prefix-length :reader prefix-length)
(words :initarg :words :reader get-word-list)))
(defun add-word-list (language prefix-length words)
"Add a new LANGUAGE to *WORD-LISTS*, where the PREFIX-LENGTH first
characters of the elements of WORDS are never the same."
(setf (gethash language *word-lists*)
(make-instance 'word-list
:language language
:prefix-length prefix-length
:words words)))
(defun available-mnemonic-seed-languages ()
"Return the list of available languages for mnemonix=c seeds."
(sort (hash-table-keys *word-lists*) #'string<))
(defun bytes->seed (bytes word-list)
"Convert the BYTES of a secret key to a mnemonic seed using words
from WORD-LIST."
(if (/= (length bytes) +secret-key-length+)
(error "Bad data length.")
(do ((word-list-length (length word-list))
(seed (make-array (* +secret-key-length+ 3/4)))
(i 0 (+ i 4))
(j 0 (+ j 3)))
((>= i +secret-key-length+) seed)
;; 8 base 16 digits -> 3 base 1626 digits
(let* ((val (bytes->integer bytes :start i :end (+ i 4)))
(q1 (floor val word-list-length))
(q2 (floor q1 word-list-length))
(w1 (mod val word-list-length))
(w2 (mod (+ q1 w1) word-list-length))
(w3 (mod (+ q2 w2) word-list-length)))
(setf (aref seed j) (elt word-list w1)
(aref seed (+ j 1)) (elt word-list w2)
(aref seed (+ j 2)) (elt word-list w3))))))
(defun seed->bytes (seed word-list prefix-length)
"Convert a mnemonic seed made of words from WORD-LIST to a secret
key made of bytes."
(if (/= (length seed) +seed-length+)
(error "Bad seed length.")
(let ((word-list-length (length word-list))
(prefix= (lambda (word1 word2)
(string= (subseq word1 0 (min prefix-length (length word1)))
(subseq word2 0 (min prefix-length (length word2)))))))
(do ((bytes (make-array (* +seed-length+ 4/3) :element-type '(unsigned-byte 8)))
(i 0 (+ i 3))
(j 0 (+ j 4)))
((>= i +seed-length+) bytes)
;; 3 base 1626 digits -> 8 base 16 digits
(let* ((w1 (position (aref seed i) word-list :test prefix=))
(w2 (position (aref seed (+ i 1)) word-list :test prefix=))
(w3 (position (aref seed (+ i 2)) word-list :test prefix=))
(val (+ w1
(* word-list-length
(mod (- w2 w1) word-list-length))
(* word-list-length
word-list-length
(mod (- w3 w2) word-list-length)))))
(if (/= (mod val word-list-length) w1)
(error "Bad seed.")
(integer->bytes val :buffer bytes :start j)))))))
(defun seed-checksum (seed prefix-length)
"Compute the checksum word of a mnemonic SEED."
(if (/= (length seed) +seed-length+)
(error "Bad seed length.")
(let* ((crc32 (make-digest :crc32))
(checksum (dotimes (i +seed-length+ (produce-digest crc32))
(let* ((word (aref seed i))
(end (min prefix-length (length word)))
(bytes (utf-8-string->bytes (subseq word 0 end))))
(update-digest crc32 bytes))))
(index (mod (bytes->integer checksum :big-endian t) +seed-length+)))
(aref seed index))))
(defun find-seed-language (seed)
"Find which language the words from the SEED are from."
(iter (for language in (available-mnemonic-seed-languages))
(let ((word-list (get-word-list (gethash language *word-lists*))))
(when (iter (for word in-vector seed)
(always (position word word-list :test #'string-equal)))
(return language)))))
(defun secret-key->mnemonic-seed (secret-key language)
"Convert a SECRET-KEY to a mnemonic seed."
(if (/= (length secret-key) +secret-key-length+)
(error "Bad secret key length.")
(let* ((language-info (or (gethash language *word-lists*)
(error "Language ~a not supported." language)))
(word-list (get-word-list language-info))
(prefix-length (prefix-length language-info))
(seed (bytes->seed secret-key word-list))
(checksum (seed-checksum seed prefix-length)))
(reduce (lambda (x y)
(concatenate 'string x " " y))
(concatenate 'vector seed (vector checksum))))))
(defun mnemonic-seed->secret-key (mnemonic-seed &optional language)
"Convert a MNEMONIC-SEED to a secret-key."
(let ((words (split-sequence #\space mnemonic-seed :remove-empty-subseqs t)))
(if (/= (length words) (1+ +seed-length+))
(error "Bad number of words in mnemonic seed.")
(let* ((seed (apply #'vector (butlast words)))
(language (or language (find-seed-language seed)))
(language-info (or (gethash language *word-lists*)
(error "Language ~a not supported." language)))
(word-list (get-word-list language-info))
(prefix-length (prefix-length language-info))
(checksum (car (last words))))
(if (string/= (seed-checksum seed prefix-length) checksum)
(error "Checksum verification failed.")
(seed->bytes seed word-list prefix-length))))))
(defun encrypt-mnemonic-seed (mnemonic-seed password &optional language)
"Encrypt a MNEMONIC-SEED with a PASSWORD and return the result as an encrypted
mnemonic seed which looks just like a not encrypted mnemonic seed. This
encryption is similar to a one-time pad, therefore the same password should not
be used for different mnemonic seeds."
(let* ((language (or language
(let ((words (split-sequence #\space mnemonic-seed :remove-empty-subseqs t)))
(find-seed-language (apply #'vector words)))))
(plaintext (mnemonic-seed->secret-key mnemonic-seed language))
(m (bytes->integer plaintext))
(encryption-key (slow-hash (utf-8-string->bytes password)))
(k (bytes->integer encryption-key))
(c (mod (+ m k) +l+))
(ciphertext (integer->bytes c :size +key-length+)))
(secret-key->mnemonic-seed ciphertext language)))
(defun decrypt-mnemonic-seed (mnemonic-seed password &optional language)
"Decrypt an encrypted MNEMONIC-SEED with a PASSWORD."
(let* ((language (or language
(let ((words (split-sequence #\space mnemonic-seed :remove-empty-subseqs t)))
(find-seed-language (apply #'vector words)))))
(ciphertext (mnemonic-seed->secret-key mnemonic-seed language))
(c (bytes->integer ciphertext))
(decryption-key (slow-hash (utf-8-string->bytes password)))
(k (bytes->integer decryption-key))
(m (mod (- c k) +l+))
(plaintext (integer->bytes m :size +key-length+)))
(secret-key->mnemonic-seed plaintext language)))
| 7,694 | Common Lisp | .lisp | 143 | 42.783217 | 100 | 0.589039 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | fb3fa8fd551866e5cfe8673d35397396f3ae40f121d9821ec15237c6d3709d95 | 8,078 | [
-1
] |
8,079 | russian.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/russian.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :russian
4
#("абажур"
"абзац"
"абонент"
"абрикос"
"абсурд"
"авангард"
"август"
"авиация"
"авоська"
"автор"
"агат"
"агент"
"агитатор"
"агнец"
"агония"
"агрегат"
"адвокат"
"адмирал"
"адрес"
"ажиотаж"
"азарт"
"азбука"
"азот"
"аист"
"айсберг"
"академия"
"аквариум"
"аккорд"
"акробат"
"аксиома"
"актер"
"акула"
"акция"
"алгоритм"
"алебарда"
"аллея"
"алмаз"
"алтарь"
"алфавит"
"алхимик"
"алый"
"альбом"
"алюминий"
"амбар"
"аметист"
"амнезия"
"ампула"
"амфора"
"анализ"
"ангел"
"анекдот"
"анимация"
"анкета"
"аномалия"
"ансамбль"
"антенна"
"апатия"
"апельсин"
"апофеоз"
"аппарат"
"апрель"
"аптека"
"арабский"
"арбуз"
"аргумент"
"арест"
"ария"
"арка"
"армия"
"аромат"
"арсенал"
"артист"
"архив"
"аршин"
"асбест"
"аскетизм"
"аспект"
"ассорти"
"астроном"
"асфальт"
"атака"
"ателье"
"атлас"
"атом"
"атрибут"
"аудитор"
"аукцион"
"аура"
"афера"
"афиша"
"ахинея"
"ацетон"
"аэропорт"
"бабушка"
"багаж"
"бадья"
"база"
"баклажан"
"балкон"
"бампер"
"банк"
"барон"
"бассейн"
"батарея"
"бахрома"
"башня"
"баян"
"бегство"
"бедро"
"бездна"
"бекон"
"белый"
"бензин"
"берег"
"беседа"
"бетонный"
"биатлон"
"библия"
"бивень"
"бигуди"
"бидон"
"бизнес"
"бикини"
"билет"
"бинокль"
"биология"
"биржа"
"бисер"
"битва"
"бицепс"
"благо"
"бледный"
"близкий"
"блок"
"блуждать"
"блюдо"
"бляха"
"бобер"
"богатый"
"бодрый"
"боевой"
"бокал"
"большой"
"борьба"
"босой"
"ботинок"
"боцман"
"бочка"
"боярин"
"брать"
"бревно"
"бригада"
"бросать"
"брызги"
"брюки"
"бублик"
"бугор"
"будущее"
"буква"
"бульвар"
"бумага"
"бунт"
"бурный"
"бусы"
"бутылка"
"буфет"
"бухта"
"бушлат"
"бывалый"
"быль"
"быстрый"
"быть"
"бюджет"
"бюро"
"бюст"
"вагон"
"важный"
"ваза"
"вакцина"
"валюта"
"вампир"
"ванная"
"вариант"
"вассал"
"вата"
"вафля"
"вахта"
"вдова"
"вдыхать"
"ведущий"
"веер"
"вежливый"
"везти"
"веко"
"великий"
"вена"
"верить"
"веселый"
"ветер"
"вечер"
"вешать"
"вещь"
"веяние"
"взаимный"
"взбучка"
"взвод"
"взгляд"
"вздыхать"
"взлетать"
"взмах"
"взнос"
"взор"
"взрыв"
"взывать"
"взятка"
"вибрация"
"визит"
"вилка"
"вино"
"вирус"
"висеть"
"витрина"
"вихрь"
"вишневый"
"включать"
"вкус"
"власть"
"влечь"
"влияние"
"влюблять"
"внешний"
"внимание"
"внук"
"внятный"
"вода"
"воевать"
"вождь"
"воздух"
"войти"
"вокзал"
"волос"
"вопрос"
"ворота"
"восток"
"впадать"
"впускать"
"врач"
"время"
"вручать"
"всадник"
"всеобщий"
"вспышка"
"встреча"
"вторник"
"вулкан"
"вурдалак"
"входить"
"въезд"
"выбор"
"вывод"
"выгодный"
"выделять"
"выезжать"
"выживать"
"вызывать"
"выигрыш"
"вылезать"
"выносить"
"выпивать"
"высокий"
"выходить"
"вычет"
"вышка"
"выяснять"
"вязать"
"вялый"
"гавань"
"гадать"
"газета"
"гаишник"
"галстук"
"гамма"
"гарантия"
"гастроли"
"гвардия"
"гвоздь"
"гектар"
"гель"
"генерал"
"геолог"
"герой"
"гешефт"
"гибель"
"гигант"
"гильза"
"гимн"
"гипотеза"
"гитара"
"глаз"
"глина"
"глоток"
"глубокий"
"глыба"
"глядеть"
"гнать"
"гнев"
"гнить"
"гном"
"гнуть"
"говорить"
"годовой"
"голова"
"гонка"
"город"
"гость"
"готовый"
"граница"
"грех"
"гриб"
"громкий"
"группа"
"грызть"
"грязный"
"губа"
"гудеть"
"гулять"
"гуманный"
"густой"
"гуща"
"давать"
"далекий"
"дама"
"данные"
"дарить"
"дать"
"дача"
"дверь"
"движение"
"двор"
"дебют"
"девушка"
"дедушка"
"дежурный"
"дезертир"
"действие"
"декабрь"
"дело"
"демократ"
"день"
"депутат"
"держать"
"десяток"
"детский"
"дефицит"
"дешевый"
"деятель"
"джаз"
"джинсы"
"джунгли"
"диалог"
"диван"
"диета"
"дизайн"
"дикий"
"динамика"
"диплом"
"директор"
"диск"
"дитя"
"дичь"
"длинный"
"дневник"
"добрый"
"доверие"
"договор"
"дождь"
"доза"
"документ"
"должен"
"домашний"
"допрос"
"дорога"
"доход"
"доцент"
"дочь"
"дощатый"
"драка"
"древний"
"дрожать"
"друг"
"дрянь"
"дубовый"
"дуга"
"дудка"
"дукат"
"дуло"
"думать"
"дупло"
"дурак"
"дуть"
"духи"
"душа"
"дуэт"
"дымить"
"дыня"
"дыра"
"дыханье"
"дышать"
"дьявол"
"дюжина"
"дюйм"
"дюна"
"дядя"
"дятел"
"егерь"
"единый"
"едкий"
"ежевика"
"ежик"
"езда"
"елка"
"емкость"
"ерунда"
"ехать"
"жадный"
"жажда"
"жалеть"
"жанр"
"жара"
"жать"
"жгучий"
"ждать"
"жевать"
"желание"
"жемчуг"
"женщина"
"жертва"
"жесткий"
"жечь"
"живой"
"жидкость"
"жизнь"
"жилье"
"жирный"
"житель"
"журнал"
"жюри"
"забывать"
"завод"
"загадка"
"задача"
"зажечь"
"зайти"
"закон"
"замечать"
"занимать"
"западный"
"зарплата"
"засыпать"
"затрата"
"захват"
"зацепка"
"зачет"
"защита"
"заявка"
"звать"
"звезда"
"звонить"
"звук"
"здание"
"здешний"
"здоровье"
"зебра"
"зевать"
"зеленый"
"земля"
"зенит"
"зеркало"
"зефир"
"зигзаг"
"зима"
"зиять"
"злак"
"злой"
"змея"
"знать"
"зной"
"зодчий"
"золотой"
"зомби"
"зона"
"зоопарк"
"зоркий"
"зрачок"
"зрение"
"зритель"
"зубной"
"зыбкий"
"зять"
"игла"
"иголка"
"играть"
"идея"
"идиот"
"идол"
"идти"
"иерархия"
"избрать"
"известие"
"изгонять"
"издание"
"излагать"
"изменять"
"износ"
"изоляция"
"изрядный"
"изучать"
"изымать"
"изящный"
"икона"
"икра"
"иллюзия"
"имбирь"
"иметь"
"имидж"
"иммунный"
"империя"
"инвестор"
"индивид"
"инерция"
"инженер"
"иномарка"
"институт"
"интерес"
"инфекция"
"инцидент"
"ипподром"
"ирис"
"ирония"
"искать"
"история"
"исходить"
"исчезать"
"итог"
"июль"
"июнь"
"кабинет"
"кавалер"
"кадр"
"казарма"
"кайф"
"кактус"
"калитка"
"камень"
"канал"
"капитан"
"картина"
"касса"
"катер"
"кафе"
"качество"
"каша"
"каюта"
"квартира"
"квинтет"
"квота"
"кедр"
"кекс"
"кенгуру"
"кепка"
"керосин"
"кетчуп"
"кефир"
"кибитка"
"кивнуть"
"кидать"
"километр"
"кино"
"киоск"
"кипеть"
"кирпич"
"кисть"
"китаец"
"класс"
"клетка"
"клиент"
"клоун"
"клуб"
"клык"
"ключ"
"клятва"
"книга"
"кнопка"
"кнут"
"князь"
"кобура"
"ковер"
"коготь"
"кодекс"
"кожа"
"козел"
"койка"
"коктейль"
"колено"
"компания"
"конец"
"копейка"
"короткий"
"костюм"
"котел"
"кофе"
"кошка"
"красный"
"кресло"
"кричать"
"кровь"
"крупный"
"крыша"
"крючок"
"кубок"
"кувшин"
"кудрявый"
"кузов"
"кукла"
"культура"
"кумир"
"купить"
"курс"
"кусок"
"кухня"
"куча"
"кушать"
"кювет"
"лабиринт"
"лавка"
"лагерь"
"ладонь"
"лазерный"
"лайнер"
"лакей"
"лампа"
"ландшафт"
"лапа"
"ларек"
"ласковый"
"лауреат"
"лачуга"
"лаять"
"лгать"
"лебедь"
"левый"
"легкий"
"ледяной"
"лежать"
"лекция"
"лента"
"лепесток"
"лесной"
"лето"
"лечь"
"леший"
"лживый"
"либерал"
"ливень"
"лига"
"лидер"
"ликовать"
"лиловый"
"лимон"
"линия"
"липа"
"лирика"
"лист"
"литр"
"лифт"
"лихой"
"лицо"
"личный"
"лишний"
"лобовой"
"ловить"
"логика"
"лодка"
"ложка"
"лозунг"
"локоть"
"ломать"
"лоно"
"лопата"
"лорд"
"лось"
"лоток"
"лохматый"
"лошадь"
"лужа"
"лукавый"
"луна"
"лупить"
"лучший"
"лыжный"
"лысый"
"львиный"
"льгота"
"льдина"
"любить"
"людской"
"люстра"
"лютый"
"лягушка"
"магазин"
"мадам"
"мазать"
"майор"
"максимум"
"мальчик"
"манера"
"март"
"масса"
"мать"
"мафия"
"махать"
"мачта"
"машина"
"маэстро"
"маяк"
"мгла"
"мебель"
"медведь"
"мелкий"
"мемуары"
"менять"
"мера"
"место"
"метод"
"механизм"
"мечтать"
"мешать"
"миграция"
"мизинец"
"микрофон"
"миллион"
"минута"
"мировой"
"миссия"
"митинг"
"мишень"
"младший"
"мнение"
"мнимый"
"могила"
"модель"
"мозг"
"мойка"
"мокрый"
"молодой"
"момент"
"монах"
"море"
"мост"
"мотор"
"мохнатый"
"мочь"
"мошенник"
"мощный"
"мрачный"
"мстить"
"мудрый"
"мужчина"
"музыка"
"мука"
"мумия"
"мундир"
"муравей"
"мусор"
"мутный"
"муфта"
"муха"
"мучить"
"мушкетер"
"мыло"
"мысль"
"мыть"
"мычать"
"мышь"
"мэтр"
"мюзикл"
"мягкий"
"мякиш"
"мясо"
"мятый"
"мячик"
"набор"
"навык"
"нагрузка"
"надежда"
"наемный"
"нажать"
"называть"
"наивный"
"накрыть"
"налог"
"намерен"
"наносить"
"написать"
"народ"
"натура"
"наука"
"нация"
"начать"
"небо"
"невеста"
"негодяй"
"неделя"
"нежный"
"незнание"
"нелепый"
"немалый"
"неправда"
"нервный"
"нести"
"нефть"
"нехватка"
"нечистый"
"неясный"
"нива"
"нижний"
"низкий"
"никель"
"нирвана"
"нить"
"ничья"
"ниша"
"нищий"
"новый"
"нога"
"ножницы"
"ноздря"
"ноль"
"номер"
"норма"
"нота"
"ночь"
"ноша"
"ноябрь"
"нрав"
"нужный"
"нутро"
"нынешний"
"нырнуть"
"ныть"
"нюанс"
"нюхать"
"няня"
"оазис"
"обаяние"
"обвинять"
"обгонять"
"обещать"
"обжигать"
"обзор"
"обида"
"область"
"обмен"
"обнимать"
"оборона"
"образ"
"обучение"
"обходить"
"обширный"
"общий"
"объект"
"обычный"
"обязать"
"овальный"
"овес"
"овощи"
"овраг"
"овца"
"овчарка"
"огненный"
"огонь"
"огромный"
"огурец"
"одежда"
"одинокий"
"одобрить"
"ожидать"
"ожог"
"озарение"
"озеро"
"означать"
"оказать"
"океан"
"оклад"
"окно"
"округ"
"октябрь"
"окурок"
"олень"
"опасный"
"операция"
"описать"
"оплата"
"опора"
"оппонент"
"опрос"
"оптимизм"
"опускать"
"опыт"
"орать"
"орбита"
"орган"
"орден"
"орел"
"оригинал"
"оркестр"
"орнамент"
"оружие"
"осадок"
"освещать"
"осень"
"осина"
"осколок"
"осмотр"
"основной"
"особый"
"осуждать"
"отбор"
"отвечать"
"отдать"
"отец"
"отзыв"
"открытие"
"отмечать"
"относить"
"отпуск"
"отрасль"
"отставка"
"оттенок"
"отходить"
"отчет"
"отъезд"
"офицер"
"охапка"
"охота"
"охрана"
"оценка"
"очаг"
"очередь"
"очищать"
"очки"
"ошейник"
"ошибка"
"ощущение"
"павильон"
"падать"
"паек"
"пакет"
"палец"
"память"
"панель"
"папка"
"партия"
"паспорт"
"патрон"
"пауза"
"пафос"
"пахнуть"
"пациент"
"пачка"
"пашня"
"певец"
"педагог"
"пейзаж"
"пельмень"
"пенсия"
"пепел"
"период"
"песня"
"петля"
"пехота"
"печать"
"пешеход"
"пещера"
"пианист"
"пиво"
"пиджак"
"пиковый"
"пилот"
"пионер"
"пирог"
"писать"
"пить"
"пицца"
"пишущий"
"пища"
"план"
"плечо"
"плита"
"плохой"
"плыть"
"плюс"
"пляж"
"победа"
"повод"
"погода"
"подумать"
"поехать"
"пожимать"
"позиция"
"поиск"
"покой"
"получать"
"помнить"
"пони"
"поощрять"
"попадать"
"порядок"
"пост"
"поток"
"похожий"
"поцелуй"
"почва"
"пощечина"
"поэт"
"пояснить"
"право"
"предмет"
"проблема"
"пруд"
"прыгать"
"прямой"
"психолог"
"птица"
"публика"
"пугать"
"пудра"
"пузырь"
"пуля"
"пункт"
"пурга"
"пустой"
"путь"
"пухлый"
"пучок"
"пушистый"
"пчела"
"пшеница"
"пыль"
"пытка"
"пыхтеть"
"пышный"
"пьеса"
"пьяный"
"пятно"
"работа"
"равный"
"радость"
"развитие"
"район"
"ракета"
"рамка"
"ранний"
"рапорт"
"рассказ"
"раунд"
"рация"
"рвать"
"реальный"
"ребенок"
"реветь"
"регион"
"редакция"
"реестр"
"режим"
"резкий"
"рейтинг"
"река"
"религия"
"ремонт"
"рента"
"реплика"
"ресурс"
"реформа"
"рецепт"
"речь"
"решение"
"ржавый"
"рисунок"
"ритм"
"рифма"
"робкий"
"ровный"
"рогатый"
"родитель"
"рождение"
"розовый"
"роковой"
"роль"
"роман"
"ронять"
"рост"
"рота"
"роща"
"рояль"
"рубль"
"ругать"
"руда"
"ружье"
"руины"
"рука"
"руль"
"румяный"
"русский"
"ручка"
"рыба"
"рывок"
"рыдать"
"рыжий"
"рынок"
"рысь"
"рыть"
"рыхлый"
"рыцарь"
"рычаг"
"рюкзак"
"рюмка"
"рябой"
"рядовой"
"сабля"
"садовый"
"сажать"
"салон"
"самолет"
"сани"
"сапог"
"сарай"
"сатира"
"сауна"
"сахар"
"сбегать"
"сбивать"
"сбор"
"сбыт"
"свадьба"
"свет"
"свидание"
"свобода"
"связь"
"сгорать"
"сдвигать"
"сеанс"
"северный"
"сегмент"
"седой"
"сезон"
"сейф"
"секунда"
"сельский"
"семья"
"сентябрь"
"сердце"
"сеть"
"сечение"
"сеять"
"сигнал"
"сидеть"
"сизый"
"сила"
"символ"
"синий"
"сирота"
"система"
"ситуация"
"сиять"
"сказать"
"скважина"
"скелет"
"скидка"
"склад"
"скорый"
"скрывать"
"скучный"
"слава"
"слеза"
"слияние"
"слово"
"случай"
"слышать"
"слюна"
"смех"
"смирение"
"смотреть"
"смутный"
"смысл"
"смятение"
"снаряд"
"снег"
"снижение"
"сносить"
"снять"
"событие"
"совет"
"согласие"
"сожалеть"
"сойти"
"сокол"
"солнце"
"сомнение"
"сонный"
"сообщать"
"соперник"
"сорт"
"состав"
"сотня"
"соус"
"социолог"
"сочинять"
"союз"
"спать"
"спешить"
"спина"
"сплошной"
"способ"
"спутник"
"средство"
"срок"
"срывать"
"стать"
"ствол"
"стена"
"стихи"
"сторона"
"страна"
"студент"
"стыд"
"субъект"
"сувенир"
"сугроб"
"судьба"
"суета"
"суждение"
"сукно"
"сулить"
"сумма"
"сунуть"
"супруг"
"суровый"
"сустав"
"суть"
"сухой"
"суша"
"существо"
"сфера"
"схема"
"сцена"
"счастье"
"счет"
"считать"
"сшивать"
"съезд"
"сынок"
"сыпать"
"сырье"
"сытый"
"сыщик"
"сюжет"
"сюрприз"
"таблица"
"таежный"
"таинство"
"тайна"
"такси"
"талант"
"таможня"
"танец"
"тарелка"
"таскать"
"тахта"
"тачка"
"таять"
"тварь"
"твердый"
"творить"
"театр"
"тезис"
"текст"
"тело"
"тема"
"тень"
"теория"
"теплый"
"терять"
"тесный"
"тетя"
"техника"
"течение"
"тигр"
"типичный"
"тираж"
"титул"
"тихий"
"тишина"
"ткань"
"товарищ"
"толпа"
"тонкий"
"топливо"
"торговля"
"тоска"
"точка"
"тощий"
"традиция"
"тревога"
"трибуна"
"трогать"
"труд"
"трюк"
"тряпка"
"туалет"
"тугой"
"туловище"
"туман"
"тундра"
"тупой"
"турнир"
"тусклый"
"туфля"
"туча"
"туша"
"тыкать"
"тысяча"
"тьма"
"тюльпан"
"тюрьма"
"тяга"
"тяжелый"
"тянуть"
"убеждать"
"убирать"
"убогий"
"убыток"
"уважение"
"уверять"
"увлекать"
"угнать"
"угол"
"угроза"
"удар"
"удивлять"
"удобный"
"уезд"
"ужас"
"ужин"
"узел"
"узкий"
"узнавать"
"узор"
"уйма"
"уклон"
"укол"
"уксус"
"улетать"
"улица"
"улучшать"
"улыбка"
"уметь"
"умиление"
"умный"
"умолять"
"умысел"
"унижать"
"уносить"
"уныние"
"упасть"
"уплата"
"упор"
"упрекать"
"упускать"
"уран"
"урна"
"уровень"
"усадьба"
"усердие"
"усилие"
"ускорять"
"условие"
"усмешка"
"уснуть"
"успеть"
"усыпать"
"утешать"
"утка"
"уточнять"
"утро"
"утюг"
"уходить"
"уцелеть"
"участие"
"ученый"
"учитель"
"ушко"
"ущерб"
"уютный"
"уяснять"
"фабрика"
"фаворит"
"фаза"
"файл"
"факт"
"фамилия"
"фантазия"
"фара"
"фасад"
"февраль"
"фельдшер"
"феномен"
"ферма"
"фигура"
"физика"
"фильм"
"финал"
"фирма"
"фишка"
"флаг"
"флейта"
"флот"
"фокус"
"фольклор"
"фонд"
"форма"
"фото"
"фраза"
"фреска"
"фронт"
"фрукт"
"функция"
"фуражка"
"футбол"
"фыркать"
"халат"
"хамство"
"хаос"
"характер"
"хата"
"хватать"
"хвост"
"хижина"
"хилый"
"химия"
"хирург"
"хитрый"
"хищник"
"хлам"
"хлеб"
"хлопать"
"хмурый"
"ходить"
"хозяин"
"хоккей"
"холодный"
"хороший"
"хотеть"
"хохотать"
"храм"
"хрен"
"хриплый"
"хроника"
"хрупкий"
"художник"
"хулиган"
"хутор"
"царь"
"цвет"
"цель"
"цемент"
"центр"
"цепь"
"церковь"
"цикл"
"цилиндр"
"циничный"
"цирк"
"цистерна"
"цитата"
"цифра"
"цыпленок"
"чадо"
"чайник"
"часть"
"чашка"
"человек"
"чемодан"
"чепуха"
"черный"
"честь"
"четкий"
"чехол"
"чиновник"
"число"
"читать"
"членство"
"чреватый"
"чтение"
"чувство"
"чугунный"
"чудо"
"чужой"
"чукча"
"чулок"
"чума"
"чуткий"
"чучело"
"чушь"
"шаблон"
"шагать"
"шайка"
"шакал"
"шалаш"
"шампунь"
"шанс"
"шапка"
"шарик"
"шасси"
"шатер"
"шахта"
"шашлык"
"швейный"
"швырять"
"шевелить"
"шедевр"
"шейка"
"шелковый"
"шептать"
"шерсть"
"шестерка"
"шикарный"
"шинель"
"шипеть"
"широкий"
"шить"
"шишка"
"шкаф"
"школа"
"шкура"
"шланг"
"шлем"
"шлюпка"
"шляпа"
"шнур"
"шоколад"
"шорох"
"шоссе"
"шофер"
"шпага"
"шпион"
"шприц"
"шрам"
"шрифт"
"штаб"
"штора"
"штраф"
"штука"
"штык"
"шуба"
"шуметь"
"шуршать"
"шутка"
"щадить"
"щедрый"
"щека"
"щель"
"щенок"
"щепка"
"щетка"
"щука"
"эволюция"
"эгоизм"
"экзамен"
"экипаж"
"экономия"
"экран"
"эксперт"
"элемент"
"элита"
"эмблема"
"эмигрант"
"эмоция"
"энергия"
"эпизод"
"эпоха"
"эскиз"
"эссе"
"эстрада"
"этап"
"этика"
"этюд"
"эфир"
"эффект"
"эшелон"
"юбилей"
"юбка"
"южный"
"юмор"
"юноша"
"юрист"
"яблоко"
"явление"
"ягода"
"ядерный"
"ядовитый"
"ядро"
"язва"
"язык"
"яйцо"
"якорь"
"январь"
"японец"
"яркий"
"ярмарка"
"ярость"
"ярус"
"ясный"
"яхта"
"ячейка"
"ящик"))
| 51,913 | Common Lisp | .lisp | 1,633 | 7.996938 | 60 | 0.239303 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 196a3ba34dd9be1a74c7343021a5f346519b8f475209e460eec45a4435999438 | 8,079 | [
-1
] |
8,080 | italian.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/italian.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :italian
4
#("abbinare"
"abbonato"
"abisso"
"abitare"
"abominio"
"accadere"
"accesso"
"acciaio"
"accordo"
"accumulo"
"acido"
"acqua"
"acrobata"
"acustico"
"adattare"
"addetto"
"addio"
"addome"
"adeguato"
"aderire"
"adorare"
"adottare"
"adozione"
"adulto"
"aereo"
"aerobica"
"affare"
"affetto"
"affidare"
"affogato"
"affronto"
"africano"
"afrodite"
"agenzia"
"aggancio"
"aggeggio"
"aggiunta"
"agio"
"agire"
"agitare"
"aglio"
"agnello"
"agosto"
"aiutare"
"albero"
"albo"
"alce"
"alchimia"
"alcool"
"alfabeto"
"algebra"
"alimento"
"allarme"
"alleanza"
"allievo"
"alloggio"
"alluce"
"alpi"
"alterare"
"altro"
"aluminio"
"amante"
"amarezza"
"ambiente"
"ambrosia"
"america"
"amico"
"ammalare"
"ammirare"
"amnesia"
"amnistia"
"amore"
"ampliare"
"amputare"
"analisi"
"anamnesi"
"ananas"
"anarchia"
"anatra"
"anca"
"ancorato"
"andare"
"androide"
"aneddoto"
"anello"
"angelo"
"angolino"
"anguilla"
"anidride"
"anima"
"annegare"
"anno"
"annuncio"
"anomalia"
"antenna"
"anticipo"
"aperto"
"apostolo"
"appalto"
"appello"
"appiglio"
"applauso"
"appoggio"
"appurare"
"aprile"
"aquila"
"arabo"
"arachidi"
"aragosta"
"arancia"
"arbitrio"
"archivio"
"arco"
"argento"
"argilla"
"aria"
"ariete"
"arma"
"armonia"
"aroma"
"arrivare"
"arrosto"
"arsenale"
"arte"
"artiglio"
"asfalto"
"asfissia"
"asino"
"asparagi"
"aspirina"
"assalire"
"assegno"
"assolto"
"assurdo"
"asta"
"astratto"
"atlante"
"atletica"
"atomo"
"atropina"
"attacco"
"attesa"
"attico"
"atto"
"attrarre"
"auguri"
"aula"
"aumento"
"aurora"
"auspicio"
"autista"
"auto"
"autunno"
"avanzare"
"avarizia"
"avere"
"aviatore"
"avido"
"avorio"
"avvenire"
"avviso"
"avvocato"
"azienda"
"azione"
"azzardo"
"azzurro"
"babbuino"
"bacio"
"badante"
"baffi"
"bagaglio"
"bagliore"
"bagno"
"balcone"
"balena"
"ballare"
"balordo"
"balsamo"
"bambola"
"bancomat"
"banda"
"barato"
"barba"
"barista"
"barriera"
"basette"
"basilico"
"bassista"
"bastare"
"battello"
"bavaglio"
"beccare"
"beduino"
"bellezza"
"bene"
"benzina"
"berretto"
"bestia"
"bevitore"
"bianco"
"bibbia"
"biberon"
"bibita"
"bici"
"bidone"
"bilancia"
"biliardo"
"binario"
"binocolo"
"biologia"
"biondina"
"biopsia"
"biossido"
"birbante"
"birra"
"biscotto"
"bisogno"
"bistecca"
"bivio"
"blindare"
"bloccare"
"bocca"
"bollire"
"bombola"
"bonifico"
"borghese"
"borsa"
"bottino"
"botulino"
"braccio"
"bradipo"
"branco"
"bravo"
"bresaola"
"bretelle"
"brevetto"
"briciola"
"brigante"
"brillare"
"brindare"
"brivido"
"broccoli"
"brontolo"
"bruciare"
"brufolo"
"bucare"
"buddista"
"budino"
"bufera"
"buffo"
"bugiardo"
"buio"
"buono"
"burrone"
"bussola"
"bustina"
"buttare"
"cabernet"
"cabina"
"cacao"
"cacciare"
"cactus"
"cadavere"
"caffe"
"calamari"
"calcio"
"caldaia"
"calmare"
"calunnia"
"calvario"
"calzone"
"cambiare"
"camera"
"camion"
"cammello"
"campana"
"canarino"
"cancello"
"candore"
"cane"
"canguro"
"cannone"
"canoa"
"cantare"
"canzone"
"caos"
"capanna"
"capello"
"capire"
"capo"
"capperi"
"capra"
"capsula"
"caraffa"
"carbone"
"carciofo"
"cardigan"
"carenza"
"caricare"
"carota"
"carrello"
"carta"
"casa"
"cascare"
"caserma"
"cashmere"
"casino"
"cassetta"
"castello"
"catalogo"
"catena"
"catorcio"
"cattivo"
"causa"
"cauzione"
"cavallo"
"caverna"
"caviglia"
"cavo"
"cazzotto"
"celibato"
"cemento"
"cenare"
"centrale"
"ceramica"
"cercare"
"ceretta"
"cerniera"
"certezza"
"cervello"
"cessione"
"cestino"
"cetriolo"
"chiave"
"chiedere"
"chilo"
"chimera"
"chiodo"
"chirurgo"
"chitarra"
"chiudere"
"ciabatta"
"ciao"
"cibo"
"ciccia"
"cicerone"
"ciclone"
"cicogna"
"cielo"
"cifra"
"cigno"
"ciliegia"
"cimitero"
"cinema"
"cinque"
"cintura"
"ciondolo"
"ciotola"
"cipolla"
"cippato"
"circuito"
"cisterna"
"citofono"
"ciuccio"
"civetta"
"civico"
"clausola"
"cliente"
"clima"
"clinica"
"cobra"
"coccole"
"cocktail"
"cocomero"
"codice"
"coesione"
"cogliere"
"cognome"
"colla"
"colomba"
"colpire"
"coltello"
"comando"
"comitato"
"commedia"
"comodino"
"compagna"
"comune"
"concerto"
"condotto"
"conforto"
"congiura"
"coniglio"
"consegna"
"conto"
"convegno"
"coperta"
"copia"
"coprire"
"corazza"
"corda"
"corleone"
"cornice"
"corona"
"corpo"
"corrente"
"corsa"
"cortesia"
"corvo"
"coso"
"costume"
"cotone"
"cottura"
"cozza"
"crampo"
"cratere"
"cravatta"
"creare"
"credere"
"crema"
"crescere"
"crimine"
"criterio"
"croce"
"crollare"
"cronaca"
"crostata"
"croupier"
"cubetto"
"cucciolo"
"cucina"
"cultura"
"cuoco"
"cuore"
"cupido"
"cupola"
"cura"
"curva"
"cuscino"
"custode"
"danzare"
"data"
"decennio"
"decidere"
"decollo"
"dedicare"
"dedurre"
"definire"
"delegare"
"delfino"
"delitto"
"demone"
"dentista"
"denuncia"
"deposito"
"derivare"
"deserto"
"designer"
"destino"
"detonare"
"dettagli"
"diagnosi"
"dialogo"
"diamante"
"diario"
"diavolo"
"dicembre"
"difesa"
"digerire"
"digitare"
"diluvio"
"dinamica"
"dipinto"
"diploma"
"diramare"
"dire"
"dirigere"
"dirupo"
"discesa"
"disdetta"
"disegno"
"disporre"
"dissenso"
"distacco"
"dito"
"ditta"
"diva"
"divenire"
"dividere"
"divorare"
"docente"
"dolcetto"
"dolore"
"domatore"
"domenica"
"dominare"
"donatore"
"donna"
"dorato"
"dormire"
"dorso"
"dosaggio"
"dottore"
"dovere"
"download"
"dragone"
"dramma"
"dubbio"
"dubitare"
"duetto"
"durata"
"ebbrezza"
"eccesso"
"eccitare"
"eclissi"
"economia"
"edera"
"edificio"
"editore"
"edizione"
"educare"
"effetto"
"egitto"
"egiziano"
"elastico"
"elefante"
"eleggere"
"elemento"
"elenco"
"elezione"
"elmetto"
"elogio"
"embrione"
"emergere"
"emettere"
"eminenza"
"emisfero"
"emozione"
"empatia"
"energia"
"enfasi"
"enigma"
"entrare"
"enzima"
"epidemia"
"epilogo"
"episodio"
"epoca"
"equivoco"
"erba"
"erede"
"eroe"
"erotico"
"errore"
"eruzione"
"esaltare"
"esame"
"esaudire"
"eseguire"
"esempio"
"esigere"
"esistere"
"esito"
"esperto"
"espresso"
"essere"
"estasi"
"esterno"
"estrarre"
"eterno"
"etica"
"euforico"
"europa"
"evacuare"
"evasione"
"evento"
"evidenza"
"evitare"
"evolvere"
"fabbrica"
"facciata"
"fagiano"
"fagotto"
"falco"
"fame"
"famiglia"
"fanale"
"fango"
"fantasia"
"farfalla"
"farmacia"
"faro"
"fase"
"fastidio"
"faticare"
"fatto"
"favola"
"febbre"
"femmina"
"femore"
"fenomeno"
"fermata"
"feromoni"
"ferrari"
"fessura"
"festa"
"fiaba"
"fiamma"
"fianco"
"fiat"
"fibbia"
"fidare"
"fieno"
"figa"
"figlio"
"figura"
"filetto"
"filmato"
"filosofo"
"filtrare"
"finanza"
"finestra"
"fingere"
"finire"
"finta"
"finzione"
"fiocco"
"fioraio"
"firewall"
"firmare"
"fisico"
"fissare"
"fittizio"
"fiume"
"flacone"
"flagello"
"flirtare"
"flusso"
"focaccia"
"foglio"
"fognario"
"follia"
"fonderia"
"fontana"
"forbici"
"forcella"
"foresta"
"forgiare"
"formare"
"fornace"
"foro"
"fortuna"
"forzare"
"fosforo"
"fotoni"
"fracasso"
"fragola"
"frantumi"
"fratello"
"frazione"
"freccia"
"freddo"
"frenare"
"fresco"
"friggere"
"frittata"
"frivolo"
"frizione"
"fronte"
"frullato"
"frumento"
"frusta"
"frutto"
"fucile"
"fuggire"
"fulmine"
"fumare"
"funzione"
"fuoco"
"furbizia"
"furgone"
"furia"
"furore"
"fusibile"
"fuso"
"futuro"
"gabbiano"
"galassia"
"gallina"
"gamba"
"gancio"
"garanzia"
"garofano"
"gasolio"
"gatto"
"gazebo"
"gazzetta"
"gelato"
"gemelli"
"generare"
"genitori"
"gennaio"
"geologia"
"germania"
"gestire"
"gettare"
"ghepardo"
"ghiaccio"
"giaccone"
"giaguaro"
"giallo"
"giappone"
"giardino"
"gigante"
"gioco"
"gioiello"
"giorno"
"giovane"
"giraffa"
"giudizio"
"giurare"
"giusto"
"globo"
"gloria"
"glucosio"
"gnocca"
"gocciola"
"godere"
"gomito"
"gomma"
"gonfiare"
"gorilla"
"governo"
"gradire"
"graffiti"
"granchio"
"grappolo"
"grasso"
"grattare"
"gridare"
"grissino"
"grondaia"
"grugnito"
"gruppo"
"guadagno"
"guaio"
"guancia"
"guardare"
"gufo"
"guidare"
"guscio"
"gusto"
"icona"
"idea"
"identico"
"idolo"
"idoneo"
"idrante"
"idrogeno"
"igiene"
"ignoto"
"imbarco"
"immagine"
"immobile"
"imparare"
"impedire"
"impianto"
"importo"
"impresa"
"impulso"
"incanto"
"incendio"
"incidere"
"incontro"
"incrocia"
"incubo"
"indagare"
"indice"
"indotto"
"infanzia"
"inferno"
"infinito"
"infranto"
"ingerire"
"inglese"
"ingoiare"
"ingresso"
"iniziare"
"innesco"
"insalata"
"inserire"
"insicuro"
"insonnia"
"insulto"
"interno"
"introiti"
"invasori"
"inverno"
"invito"
"invocare"
"ipnosi"
"ipocrita"
"ipotesi"
"ironia"
"irrigare"
"iscritto"
"isola"
"ispirare"
"isterico"
"istinto"
"istruire"
"italiano"
"jazz"
"labbra"
"labrador"
"ladro"
"lago"
"lamento"
"lampone"
"lancetta"
"lanterna"
"lapide"
"larva"
"lasagne"
"lasciare"
"lastra"
"latte"
"laurea"
"lavagna"
"lavorare"
"leccare"
"legare"
"leggere"
"lenzuolo"
"leone"
"lepre"
"letargo"
"lettera"
"levare"
"levitare"
"lezione"
"liberare"
"libidine"
"libro"
"licenza"
"lievito"
"limite"
"lince"
"lingua"
"liquore"
"lire"
"listino"
"litigare"
"litro"
"locale"
"lottare"
"lucciola"
"lucidare"
"luglio"
"luna"
"macchina"
"madama"
"madre"
"maestro"
"maggio"
"magico"
"maglione"
"magnolia"
"mago"
"maialino"
"maionese"
"malattia"
"male"
"malloppo"
"mancare"
"mandorla"
"mangiare"
"manico"
"manopola"
"mansarda"
"mantello"
"manubrio"
"manzo"
"mappa"
"mare"
"margine"
"marinaio"
"marmotta"
"marocco"
"martello"
"marzo"
"maschera"
"matrice"
"maturare"
"mazzetta"
"meandri"
"medaglia"
"medico"
"medusa"
"megafono"
"melone"
"membrana"
"menta"
"mercato"
"meritare"
"merluzzo"
"mese"
"mestiere"
"metafora"
"meteo"
"metodo"
"mettere"
"miele"
"miglio"
"miliardo"
"mimetica"
"minatore"
"minuto"
"miracolo"
"mirtillo"
"missile"
"mistero"
"misura"
"mito"
"mobile"
"moda"
"moderare"
"moglie"
"molecola"
"molle"
"momento"
"moneta"
"mongolia"
"monologo"
"montagna"
"morale"
"morbillo"
"mordere"
"mosaico"
"mosca"
"mostro"
"motivare"
"moto"
"mulino"
"mulo"
"muovere"
"muraglia"
"muscolo"
"museo"
"musica"
"mutande"
"nascere"
"nastro"
"natale"
"natura"
"nave"
"navigare"
"negare"
"negozio"
"nemico"
"nero"
"nervo"
"nessuno"
"nettare"
"neutroni"
"neve"
"nevicare"
"nicotina"
"nido"
"nipote"
"nocciola"
"noleggio"
"nome"
"nonno"
"norvegia"
"notare"
"notizia"
"nove"
"nucleo"
"nuda"
"nuotare"
"nutrire"
"obbligo"
"occhio"
"occupare"
"oceano"
"odissea"
"odore"
"offerta"
"officina"
"offrire"
"oggetto"
"oggi"
"olfatto"
"olio"
"oliva"
"ombelico"
"ombrello"
"omuncolo"
"ondata"
"onore"
"opera"
"opinione"
"opuscolo"
"opzione"
"orario"
"orbita"
"orchidea"
"ordine"
"orecchio"
"orgasmo"
"orgoglio"
"origine"
"orologio"
"oroscopo"
"orso"
"oscurare"
"ospedale"
"ospite"
"ossigeno"
"ostacolo"
"ostriche"
"ottenere"
"ottimo"
"ottobre"
"ovest"
"pacco"
"pace"
"pacifico"
"padella"
"pagare"
"pagina"
"pagnotta"
"palazzo"
"palestra"
"palpebre"
"pancetta"
"panfilo"
"panino"
"pannello"
"panorama"
"papa"
"paperino"
"paradiso"
"parcella"
"parente"
"parlare"
"parodia"
"parrucca"
"partire"
"passare"
"pasta"
"patata"
"patente"
"patogeno"
"patriota"
"pausa"
"pazienza"
"peccare"
"pecora"
"pedalare"
"pelare"
"pena"
"pendenza"
"penisola"
"pennello"
"pensare"
"pentirsi"
"percorso"
"perdono"
"perfetto"
"perizoma"
"perla"
"permesso"
"persona"
"pesare"
"pesce"
"peso"
"petardo"
"petrolio"
"pezzo"
"piacere"
"pianeta"
"piastra"
"piatto"
"piazza"
"piccolo"
"piede"
"piegare"
"pietra"
"pigiama"
"pigliare"
"pigrizia"
"pilastro"
"pilota"
"pinguino"
"pioggia"
"piombo"
"pionieri"
"piovra"
"pipa"
"pirata"
"pirolisi"
"piscina"
"pisolino"
"pista"
"pitone"
"piumino"
"pizza"
"plastica"
"platino"
"poesia"
"poiana"
"polaroid"
"polenta"
"polimero"
"pollo"
"polmone"
"polpetta"
"poltrona"
"pomodoro"
"pompa"
"popolo"
"porco"
"porta"
"porzione"
"possesso"
"postino"
"potassio"
"potere"
"poverino"
"pranzo"
"prato"
"prefisso"
"prelievo"
"premio"
"prendere"
"prestare"
"pretesa"
"prezzo"
"primario"
"privacy"
"problema"
"processo"
"prodotto"
"profeta"
"progetto"
"promessa"
"pronto"
"proposta"
"proroga"
"prossimo"
"proteina"
"prova"
"prudenza"
"pubblico"
"pudore"
"pugilato"
"pulire"
"pulsante"
"puntare"
"pupazzo"
"puzzle"
"quaderno"
"qualcuno"
"quarzo"
"quercia"
"quintale"
"rabbia"
"racconto"
"radice"
"raffica"
"ragazza"
"ragione"
"rammento"
"ramo"
"rana"
"randagio"
"rapace"
"rapinare"
"rapporto"
"rasatura"
"ravioli"
"reagire"
"realista"
"reattore"
"reazione"
"recitare"
"recluso"
"record"
"recupero"
"redigere"
"regalare"
"regina"
"regola"
"relatore"
"reliquia"
"remare"
"rendere"
"reparto"
"resina"
"resto"
"rete"
"retorica"
"rettile"
"revocare"
"riaprire"
"ribadire"
"ribelle"
"ricambio"
"ricetta"
"richiamo"
"ricordo"
"ridurre"
"riempire"
"riferire"
"riflesso"
"righello"
"rilancio"
"rilevare"
"rilievo"
"rimanere"
"rimborso"
"rinforzo"
"rinuncia"
"riparo"
"ripetere"
"riposare"
"ripulire"
"risalita"
"riscatto"
"riserva"
"riso"
"rispetto"
"ritaglio"
"ritmo"
"ritorno"
"ritratto"
"rituale"
"riunione"
"riuscire"
"riva"
"robotica"
"rondine"
"rosa"
"rospo"
"rosso"
"rotonda"
"rotta"
"roulotte"
"rubare"
"rubrica"
"ruffiano"
"rumore"
"ruota"
"ruscello"
"sabbia"
"sacco"
"saggio"
"sale"
"salire"
"salmone"
"salto"
"salutare"
"salvia"
"sangue"
"sanzioni"
"sapere"
"sapienza"
"sarcasmo"
"sardine"
"sartoria"
"sbalzo"
"sbarcare"
"sberla"
"sborsare"
"scadenza"
"scafo"
"scala"
"scambio"
"scappare"
"scarpa"
"scatola"
"scelta"
"scena"
"sceriffo"
"scheggia"
"schiuma"
"sciarpa"
"scienza"
"scimmia"
"sciopero"
"scivolo"
"sclerare"
"scolpire"
"sconto"
"scopa"
"scordare"
"scossa"
"scrivere"
"scrupolo"
"scuderia"
"scultore"
"scuola"
"scusare"
"sdraiare"
"secolo"
"sedativo"
"sedere"
"sedia"
"segare"
"segreto"
"seguire"
"semaforo"
"seme"
"senape"
"seno"
"sentiero"
"separare"
"sepolcro"
"sequenza"
"serata"
"serpente"
"servizio"
"sesso"
"seta"
"settore"
"sfamare"
"sfera"
"sfidare"
"sfiorare"
"sfogare"
"sgabello"
"sicuro"
"siepe"
"sigaro"
"silenzio"
"silicone"
"simbiosi"
"simpatia"
"simulare"
"sinapsi"
"sindrome"
"sinergia"
"sinonimo"
"sintonia"
"sirena"
"siringa"
"sistema"
"sito"
"smalto"
"smentire"
"smontare"
"soccorso"
"socio"
"soffitto"
"software"
"soggetto"
"sogliola"
"sognare"
"soldi"
"sole"
"sollievo"
"solo"
"sommario"
"sondare"
"sonno"
"sorpresa"
"sorriso"
"sospiro"
"sostegno"
"sovrano"
"spaccare"
"spada"
"spagnolo"
"spalla"
"sparire"
"spavento"
"spazio"
"specchio"
"spedire"
"spegnere"
"spendere"
"speranza"
"spessore"
"spezzare"
"spiaggia"
"spiccare"
"spiegare"
"spiffero"
"spingere"
"sponda"
"sporcare"
"spostare"
"spremuta"
"spugna"
"spumante"
"spuntare"
"squadra"
"squillo"
"staccare"
"stadio"
"stagione"
"stallone"
"stampa"
"stancare"
"starnuto"
"statura"
"stella"
"stendere"
"sterzo"
"stilista"
"stimolo"
"stinco"
"stiva"
"stoffa"
"storia"
"strada"
"stregone"
"striscia"
"studiare"
"stufa"
"stupendo"
"subire"
"successo"
"sudare"
"suono"
"superare"
"supporto"
"surfista"
"sussurro"
"svelto"
"svenire"
"sviluppo"
"svolta"
"svuotare"
"tabacco"
"tabella"
"tabu"
"tacchino"
"tacere"
"taglio"
"talento"
"tangente"
"tappeto"
"tartufo"
"tassello"
"tastiera"
"tavolo"
"tazza"
"teatro"
"tedesco"
"telaio"
"telefono"
"tema"
"temere"
"tempo"
"tendenza"
"tenebre"
"tensione"
"tentare"
"teologia"
"teorema"
"termica"
"terrazzo"
"teschio"
"tesi"
"tesoro"
"tessera"
"testa"
"thriller"
"tifoso"
"tigre"
"timbrare"
"timido"
"tinta"
"tirare"
"tisana"
"titano"
"titolo"
"toccare"
"togliere"
"topolino"
"torcia"
"torrente"
"tovaglia"
"traffico"
"tragitto"
"training"
"tramonto"
"transito"
"trapezio"
"trasloco"
"trattore"
"trazione"
"treccia"
"tregua"
"treno"
"triciclo"
"tridente"
"trilogia"
"tromba"
"troncare"
"trota"
"trovare"
"trucco"
"tubo"
"tulipano"
"tumulto"
"tunisia"
"tuono"
"turista"
"tuta"
"tutelare"
"tutore"
"ubriaco"
"uccello"
"udienza"
"udito"
"uffa"
"umanoide"
"umore"
"unghia"
"unguento"
"unicorno"
"unione"
"universo"
"uomo"
"uragano"
"uranio"
"urlare"
"uscire"
"utente"
"utilizzo"
"vacanza"
"vacca"
"vaglio"
"vagonata"
"valle"
"valore"
"valutare"
"valvola"
"vampiro"
"vaniglia"
"vanto"
"vapore"
"variante"
"vasca"
"vaselina"
"vassoio"
"vedere"
"vegetale"
"veglia"
"veicolo"
"vela"
"veleno"
"velivolo"
"velluto"
"vendere"
"venerare"
"venire"
"vento"
"veranda"
"verbo"
"verdura"
"vergine"
"verifica"
"vernice"
"vero"
"verruca"
"versare"
"vertebra"
"vescica"
"vespaio"
"vestito"
"vesuvio"
"veterano"
"vetro"
"vetta"
"viadotto"
"viaggio"
"vibrare"
"vicenda"
"vichingo"
"vietare"
"vigilare"
"vigneto"
"villa"
"vincere"
"violino"
"vipera"
"virgola"
"virtuoso"
"visita"
"vita"
"vitello"
"vittima"
"vivavoce"
"vivere"
"viziato"
"voglia"
"volare"
"volpe"
"volto"
"volume"
"vongole"
"voragine"
"vortice"
"votare"
"vulcano"
"vuotare"
"zabaione"
"zaffiro"
"zainetto"
"zampa"
"zanzara"
"zattera"
"zavorra"
"zenzero"
"zero"
"zingaro"
"zittire"
"zoccolo"
"zolfo"
"zombie"
"zucchero"))
| 43,937 | Common Lisp | .lisp | 1,633 | 8.968157 | 60 | 0.267825 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 49525d73252d999f1037e5986a26e08dba603930f25c149fd21700b6b9f29738 | 8,080 | [
-1
] |
8,081 | esperanto.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/esperanto.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :esperanto
4
#("abako"
"abdiki"
"abelo"
"abituriento"
"ablativo"
"abnorma"
"abonantoj"
"abrikoto"
"absoluta"
"abunda"
"acetono"
"acida"
"adapti"
"adekvata"
"adheri"
"adicii"
"adjektivo"
"administri"
"adolesko"
"adreso"
"adstringa"
"adulto"
"advokato"
"adzo"
"aeroplano"
"aferulo"
"afgana"
"afiksi"
"aflaba"
"aforismo"
"afranki"
"aftozo"
"afusto"
"agavo"
"agento"
"agiti"
"aglo"
"agmaniero"
"agnoski"
"agordo"
"agrabla"
"agtipo"
"agutio"
"aikido"
"ailanto"
"aina"
"ajatolo"
"ajgenvaloro"
"ajlobulbo"
"ajnlitera"
"ajuto"
"ajzi"
"akademio"
"akcepti"
"akeo"
"akiri"
"aklamado"
"akmeo"
"akno"
"akompani"
"akrobato"
"akselo"
"aktiva"
"akurata"
"akvofalo"
"alarmo"
"albumo"
"alcedo"
"aldoni"
"aleo"
"alfabeto"
"algo"
"alhasti"
"aligatoro"
"alkoholo"
"almozo"
"alnomo"
"alojo"
"alpinisto"
"alrigardi"
"alskribi"
"alta"
"alumeto"
"alveni"
"alzaca"
"amaso"
"ambasado"
"amdeklaro"
"amebo"
"amfibio"
"amhara"
"amiko"
"amkanto"
"amletero"
"amnestio"
"amoranto"
"amplekso"
"amrakonto"
"amsterdama"
"amuzi"
"ananaso"
"androido"
"anekdoto"
"anfrakto"
"angulo"
"anheli"
"animo"
"anjono"
"ankro"
"anonci"
"anpriskribo"
"ansero"
"antikva"
"anuitato"
"aorto"
"aparta"
"aperti"
"apika"
"aplikado"
"apneo"
"apogi"
"aprobi"
"apsido"
"apterigo"
"apudesto"
"araneo"
"arbo"
"ardeco"
"aresti"
"argilo"
"aristokrato"
"arko"
"arlekeno"
"armi"
"arniko"
"aromo"
"arpio"
"arsenalo"
"artisto"
"aruba"
"arvorto"
"asaio"
"asbesto"
"ascendi"
"asekuri"
"asfalto"
"asisti"
"askalono"
"asocio"
"aspekti"
"astro"
"asulo"
"atakonto"
"atendi"
"atingi"
"atleto"
"atmosfero"
"atomo"
"atropino"
"atuto"
"avataro"
"aventuro"
"aviadilo"
"avokado"
"azaleo"
"azbuko"
"azenino"
"azilpetanto"
"azoto"
"azteka"
"babili"
"bacilo"
"badmintono"
"bagatelo"
"bahama"
"bajoneto"
"baki"
"balai"
"bambuo"
"bani"
"baobabo"
"bapti"
"baro"
"bastono"
"batilo"
"bavara"
"bazalto"
"beata"
"bebofono"
"bedo"
"begonio"
"behaviorismo"
"bejlo"
"bekero"
"belarto"
"bemolo"
"benko"
"bereto"
"besto"
"betulo"
"bevelo"
"bezoni"
"biaso"
"biblioteko"
"biciklo"
"bidaro"
"bieno"
"bifsteko"
"bigamiulo"
"bijekcio"
"bikino"
"bildo"
"bimetalismo"
"bindi"
"biografio"
"birdo"
"biskvito"
"bitlibro"
"bivako"
"bizara"
"bjalistoka"
"blanka"
"bleki"
"blinda"
"blovi"
"blua"
"boato"
"bobsledo"
"bocvanano"
"bodisatvo"
"bofratino"
"bogefratoj"
"bohema"
"boji"
"bokalo"
"boli"
"bombono"
"bona"
"bopatrino"
"bordo"
"bosko"
"botelo"
"bovido"
"brakpleno"
"bretaro"
"brikmuro"
"broso"
"brulema"
"bubalo"
"buctrapi"
"budo"
"bufedo"
"bugio"
"bujabeso"
"buklo"
"buldozo"
"bumerango"
"bunta"
"burokrataro"
"busbileto"
"butero"
"buzuko"
"caro"
"cebo"
"ceceo"
"cedro"
"cefalo"
"cejana"
"cekumo"
"celebri"
"cemento"
"cent"
"cepo"
"certa"
"cetera"
"cezio"
"ciano"
"cibeto"
"cico"
"cidro"
"cifero"
"cigaredo"
"ciklo"
"cilindro"
"cimbalo"
"cinamo"
"cipreso"
"cirkonstanco"
"cisterno"
"citrono"
"ciumi"
"civilizado"
"colo"
"congo"
"cunamo"
"cvana"
"dabi"
"daco"
"dadaismo"
"dafodilo"
"dago"
"daimio"
"dajmono"
"daktilo"
"dalio"
"damo"
"danki"
"darmo"
"datumoj"
"dazipo"
"deadmoni"
"debeto"
"decidi"
"dedukti"
"deerigi"
"defendi"
"degeli"
"dehaki"
"deirpunkto"
"deklaracio"
"delikata"
"demandi"
"dento"
"dependi"
"derivi"
"desegni"
"detrui"
"devi"
"deziri"
"dialogo"
"dicentro"
"didaktika"
"dieto"
"diferenci"
"digesti"
"diino"
"dikfingro"
"diligenta"
"dimensio"
"dinamo"
"diodo"
"diplomo"
"direkte"
"diskuti"
"diurno"
"diversa"
"dizajno"
"dobrogitaro"
"docento"
"dogano"
"dojeno"
"doktoro"
"dolori"
"domego"
"donaci"
"dopado"
"dormi"
"dosierujo"
"dotita"
"dozeno"
"drato"
"dresi"
"drinki"
"droni"
"druido"
"duaranga"
"dubi"
"ducent"
"dudek"
"duelo"
"dufoje"
"dugongo"
"duhufa"
"duilo"
"dujare"
"dukato"
"duloka"
"dumtempe"
"dungi"
"duobla"
"dupiedulo"
"dura"
"dusenca"
"dutaga"
"duuma"
"duvalvuloj"
"duzo"
"ebena"
"eblecoj"
"ebono"
"ebria"
"eburo"
"ecaro"
"ecigi"
"ecoj"
"edelvejso"
"editoro"
"edro"
"eduki"
"edzino"
"efektiva"
"efiki"
"efloreski"
"egala"
"egeco"
"egiptologo"
"eglefino"
"egoista"
"egreto"
"ejakuli"
"ejlo"
"ekarto"
"ekbruligi"
"ekceli"
"ekde"
"ekesti"
"ekfirmao"
"ekgliti"
"ekhavi"
"ekipi"
"ekkapti"
"eklezio"
"ekmalsati"
"ekonomio"
"ekpluvi"
"ekrano"
"ekster"
"ektiri"
"ekumeno"
"ekvilibro"
"ekzemplo"
"elasta"
"elbalai"
"elcento"
"eldoni"
"elektro"
"elfari"
"elgliti"
"elhaki"
"elipso"
"elkovi"
"ellasi"
"elmeti"
"elnutri"
"elokventa"
"elparoli"
"elrevigi"
"elstari"
"elteni"
"eluzita"
"elvoki"
"elzasa"
"emajlo"
"embaraso"
"emerito"
"emfazo"
"eminenta"
"emocio"
"empiria"
"emulsio"
"enarkivigi"
"enboteligi"
"enciklopedio"
"endorfino"
"energio"
"enfermi"
"engluti"
"enhavo"
"enigmo"
"enjekcio"
"enketi"
"enlanda"
"enmeti"
"enorma"
"enplanti"
"enradiki"
"enspezo"
"entrepreni"
"enui"
"envolvi"
"enzimo"
"eono"
"eosto"
"epitafo"
"epoko"
"epriskribebla"
"epsilono"
"erari"
"erbio"
"erco"
"erekti"
"ergonomia"
"erikejo"
"ermito"
"erotika"
"erpilo"
"erupcio"
"esameno"
"escepti"
"esenco"
"eskapi"
"esotera"
"esperi"
"estonto"
"etapo"
"etendi"
"etfingro"
"etikedo"
"etlitero"
"etmakleristo"
"etnika"
"etoso"
"etradio"
"etskala"
"etullernejo"
"evakui"
"evento"
"eviti"
"evolui"
"ezoko"
"fabriko"
"facila"
"fadeno"
"fagoto"
"fajro"
"fakto"
"fali"
"familio"
"fanatiko"
"farbo"
"fasko"
"fatala"
"favora"
"fazeolo"
"febro"
"federacio"
"feino"
"fekunda"
"felo"
"femuro"
"fenestro"
"fermi"
"festi"
"fetora"
"fezo"
"fiasko"
"fibro"
"fidela"
"fiera"
"fifama"
"figuro"
"fiherbo"
"fiinsekto"
"fiksa"
"filmo"
"fimensa"
"finalo"
"fiolo"
"fiparoli"
"firmao"
"fisko"
"fitingo"
"fiuzanto"
"fivorto"
"fiziko"
"fjordo"
"flago"
"flegi"
"flirti"
"floro"
"flugi"
"fobio"
"foceno"
"foirejo"
"fojfoje"
"fokuso"
"folio"
"fomenti"
"fonto"
"formulo"
"fosforo"
"fotografi"
"fratino"
"fremda"
"friti"
"frosto"
"frua"
"ftizo"
"fuelo"
"fugo"
"fuksia"
"fulmilo"
"fumanto"
"fundamento"
"fuorto"
"furioza"
"fusilo"
"futbalo"
"fuzio"
"gabardino"
"gado"
"gaela"
"gafo"
"gagato"
"gaja"
"gaki"
"galanta"
"gamao"
"ganto"
"gapulo"
"gardi"
"gasto"
"gavio"
"gazeto"
"geamantoj"
"gebani"
"geedzeco"
"gefratoj"
"geheno"
"gejsero"
"geko"
"gelateno"
"gemisto"
"geniulo"
"geografio"
"gepardo"
"geranio"
"gestolingvo"
"geto"
"geumo"
"gibono"
"giganta"
"gildo"
"gimnastiko"
"ginekologo"
"gipsi"
"girlando"
"gistfungo"
"gitaro"
"glazuro"
"glebo"
"gliti"
"globo"
"gluti"
"gnafalio"
"gnejso"
"gnomo"
"gnuo"
"gobio"
"godetio"
"goeleto"
"gojo"
"golfludejo"
"gombo"
"gondolo"
"gorilo"
"gospelo"
"gotika"
"granda"
"greno"
"griza"
"groto"
"grupo"
"guano"
"gubernatoro"
"gudrotuko"
"gufo"
"gujavo"
"guldeno"
"gumi"
"gupio"
"guruo"
"gusto"
"guto"
"guvernistino"
"gvardio"
"gverilo"
"gvidanto"
"habitato"
"hadito"
"hafnio"
"hagiografio"
"haitiano"
"hajlo"
"hakbloko"
"halti"
"hamstro"
"hangaro"
"hapalo"
"haro"
"hasta"
"hati"
"havebla"
"hazardo"
"hebrea"
"hedero"
"hegemonio"
"hejmo"
"hektaro"
"helpi"
"hemisfero"
"heni"
"hepato"
"herbo"
"hesa"
"heterogena"
"heziti"
"hiacinto"
"hibrida"
"hidrogeno"
"hieroglifo"
"higieno"
"hihii"
"hilumo"
"himno"
"hindino"
"hiperteksto"
"hirundo"
"historio"
"hobio"
"hojli"
"hokeo"
"hologramo"
"homido"
"honesta"
"hopi"
"horizonto"
"hospitalo"
"hotelo"
"huadi"
"hubo"
"hufumo"
"hugenoto"
"hukero"
"huligano"
"humana"
"hundo"
"huoj"
"hupilo"
"hurai"
"husaro"
"hutuo"
"huzo"
"iafoje"
"iagrade"
"iamaniere"
"iarelate"
"iaspeca"
"ibekso"
"ibiso"
"idaro"
"ideala"
"idiomo"
"idolo"
"iele"
"igluo"
"ignori"
"iguamo"
"igvano"
"ikono"
"iksodo"
"ikto"
"iliaflanke"
"ilkomputilo"
"ilobreto"
"ilremedo"
"ilumini"
"imagi"
"imitado"
"imperio"
"imuna"
"incidento"
"industrio"
"inerta"
"infano"
"ingenra"
"inhali"
"iniciati"
"injekti"
"inklino"
"inokuli"
"insekto"
"inteligenta"
"inundi"
"inviti"
"ioma"
"ionosfero"
"iperito"
"ipomeo"
"irana"
"irejo"
"irigacio"
"ironio"
"isato"
"islamo"
"istempo"
"itinero"
"itrio"
"iuloke"
"iumaniere"
"iutempe"
"izolita"
"jado"
"jaguaro"
"jakto"
"jama"
"januaro"
"japano"
"jarringo"
"jazo"
"jenoj"
"jesulo"
"jetavio"
"jezuito"
"jodli"
"joviala"
"juano"
"jubileo"
"judismo"
"jufto"
"juki"
"julio"
"juneca"
"jupo"
"juristo"
"juste"
"juvelo"
"kabineto"
"kadrato"
"kafo"
"kahelo"
"kajako"
"kakao"
"kalkuli"
"kampo"
"kanti"
"kapitalo"
"karaktero"
"kaserolo"
"katapulto"
"kaverna"
"kazino"
"kebabo"
"kefiro"
"keglo"
"kejlo"
"kekso"
"kelka"
"kemio"
"kerno"
"kesto"
"kiamaniere"
"kibuco"
"kidnapi"
"kielo"
"kikero"
"kilogramo"
"kimono"
"kinejo"
"kiosko"
"kirurgo"
"kisi"
"kitelo"
"kivio"
"klavaro"
"klerulo"
"klini"
"klopodi"
"klubo"
"knabo"
"knedi"
"koalo"
"kobalto"
"kodigi"
"kofro"
"kohera"
"koincidi"
"kojoto"
"kokoso"
"koloro"
"komenci"
"kontrakto"
"kopio"
"korekte"
"kosti"
"kotono"
"kovri"
"krajono"
"kredi"
"krii"
"krom"
"kruco"
"ksantino"
"ksenono"
"ksilofono"
"ksosa"
"kubuto"
"kudri"
"kuglo"
"kuiri"
"kuko"
"kulero"
"kumuluso"
"kuneco"
"kupro"
"kuri"
"kuseno"
"kutimo"
"kuvo"
"kuzino"
"kvalito"
"kverko"
"kvin"
"kvoto"
"labori"
"laculo"
"ladbotelo"
"lafo"
"laguno"
"laikino"
"laktobovino"
"lampolumo"
"landkarto"
"laosa"
"lapono"
"larmoguto"
"lastjare"
"latitudo"
"lavejo"
"lazanjo"
"leciono"
"ledosako"
"leganto"
"lekcio"
"lemura"
"lentuga"
"leopardo"
"leporo"
"lerni"
"lesivo"
"letero"
"levilo"
"lezi"
"liano"
"libera"
"liceo"
"lieno"
"lifto"
"ligilo"
"likvoro"
"lila"
"limono"
"lingvo"
"lipo"
"lirika"
"listo"
"literatura"
"liveri"
"lobio"
"logika"
"lojala"
"lokalo"
"longa"
"lordo"
"lotado"
"loza"
"luanto"
"lubriki"
"lucida"
"ludema"
"luigi"
"lukso"
"luli"
"lumbilda"
"lunde"
"lupago"
"lustro"
"lutilo"
"luzerno"
"maato"
"maceri"
"madono"
"mafiano"
"magazeno"
"mahometano"
"maizo"
"majstro"
"maketo"
"malgranda"
"mamo"
"mandareno"
"maorio"
"mapigi"
"marini"
"masko"
"mateno"
"mazuto"
"meandro"
"meblo"
"mecenato"
"medialo"
"mefito"
"megafono"
"mejlo"
"mekanika"
"melodia"
"membro"
"mendi"
"mergi"
"mespilo"
"metoda"
"mevo"
"mezuri"
"miaflanke"
"micelio"
"mielo"
"migdalo"
"mikrofilmo"
"militi"
"mimiko"
"mineralo"
"miopa"
"miri"
"mistera"
"mitralo"
"mizeri"
"mjelo"
"mnemoniko"
"mobilizi"
"mocio"
"moderna"
"mohajro"
"mokadi"
"molaro"
"momento"
"monero"
"mopso"
"mordi"
"moskito"
"motoro"
"movimento"
"mozaiko"
"mueli"
"mukozo"
"muldi"
"mumio"
"munti"
"muro"
"muskolo"
"mutacio"
"muzikisto"
"nabo"
"nacio"
"nadlo"
"nafto"
"naiva"
"najbaro"
"nanometro"
"napo"
"narciso"
"naski"
"naturo"
"navigi"
"naztruo"
"neatendite"
"nebulo"
"necesa"
"nedankinde"
"neebla"
"nefari"
"negoco"
"nehavi"
"neimagebla"
"nektaro"
"nelonga"
"nematura"
"nenia"
"neordinara"
"nepra"
"nervuro"
"nesto"
"nete"
"neulo"
"nevino"
"nifo"
"nigra"
"nihilisto"
"nikotino"
"nilono"
"nimfeo"
"nitrogeno"
"nivelo"
"nobla"
"nocio"
"nodozo"
"nokto"
"nomkarto"
"norda"
"nostalgio"
"notbloko"
"novico"
"nuanco"
"nuboza"
"nuda"
"nugato"
"nuklea"
"nuligi"
"numero"
"nuntempe"
"nupto"
"nura"
"nutri"
"oazo"
"obei"
"objekto"
"oblikva"
"obolo"
"observi"
"obtuza"
"obuso"
"oceano"
"odekolono"
"odori"
"oferti"
"oficiala"
"ofsajdo"
"ofte"
"ogivo"
"ogro"
"ojstredoj"
"okaze"
"okcidenta"
"okro"
"oksido"
"oktobro"
"okulo"
"oldulo"
"oleo"
"olivo"
"omaro"
"ombro"
"omego"
"omikrono"
"omleto"
"omnibuso"
"onagro"
"ondo"
"oneco"
"onidire"
"onklino"
"onlajna"
"onomatopeo"
"ontologio"
"opaka"
"operacii"
"opinii"
"oportuna"
"opresi"
"optimisto"
"oratoro"
"orbito"
"ordinara"
"orelo"
"orfino"
"organizi"
"orienta"
"orkestro"
"orlo"
"orminejo"
"ornami"
"ortangulo"
"orumi"
"oscedi"
"osmozo"
"ostocerbo"
"ovalo"
"ovingo"
"ovoblanko"
"ovri"
"ovulado"
"ozono"
"pacama"
"padeli"
"pafilo"
"pagigi"
"pajlo"
"paketo"
"palaco"
"pampelmo"
"pantalono"
"papero"
"paroli"
"pasejo"
"patro"
"pavimo"
"peco"
"pedalo"
"peklita"
"pelikano"
"pensiono"
"peplomo"
"pesilo"
"petanto"
"pezoforto"
"piano"
"picejo"
"piede"
"pigmento"
"pikema"
"pilkoludo"
"pimento"
"pinglo"
"pioniro"
"pipromento"
"pirato"
"pistolo"
"pitoreska"
"piulo"
"pivoti"
"pizango"
"planko"
"plektita"
"plibonigi"
"ploradi"
"plurlingva"
"pobo"
"podio"
"poeto"
"pogranda"
"pohora"
"pokalo"
"politekniko"
"pomarbo"
"ponevosto"
"populara"
"porcelana"
"postkompreno"
"poteto"
"poviga"
"pozitiva"
"prapatroj"
"precize"
"pridemandi"
"probable"
"pruntanto"
"psalmo"
"psikologio"
"psoriazo"
"pterido"
"publiko"
"pudro"
"pufo"
"pugnobato"
"pulovero"
"pumpi"
"punkto"
"pupo"
"pureo"
"puso"
"putrema"
"puzlo"
"rabate"
"racionala"
"radiko"
"rafinado"
"raguo"
"rajto"
"rakonti"
"ralio"
"rampi"
"rando"
"rapida"
"rastruma"
"ratifiki"
"raviolo"
"razeno"
"reakcio"
"rebildo"
"recepto"
"redakti"
"reenigi"
"reformi"
"regiono"
"rehavi"
"reinspekti"
"rejesi"
"reklamo"
"relativa"
"rememori"
"renkonti"
"reorganizado"
"reprezenti"
"respondi"
"retumilo"
"reuzebla"
"revidi"
"rezulti"
"rialo"
"ribeli"
"ricevi"
"ridiga"
"rifuginto"
"rigardi"
"rikolti"
"rilati"
"rimarki"
"rinocero"
"ripozi"
"riski"
"ritmo"
"rivero"
"rizokampo"
"roboto"
"rododendro"
"rojo"
"rokmuziko"
"rolvorto"
"romantika"
"ronroni"
"rosino"
"rotondo"
"rovero"
"rozeto"
"rubando"
"rudimenta"
"rufa"
"rugbeo"
"ruino"
"ruleto"
"rumoro"
"runo"
"rupio"
"rura"
"rustimuna"
"ruzulo"
"sabato"
"sadismo"
"safario"
"sagaca"
"sakfluto"
"salti"
"samtage"
"sandalo"
"sapejo"
"sarongo"
"satelito"
"savano"
"sbiro"
"sciado"
"seanco"
"sebo"
"sedativo"
"segligno"
"sekretario"
"selektiva"
"semajno"
"senpeza"
"separeo"
"servilo"
"sesangulo"
"setli"
"seurigi"
"severa"
"sezono"
"sfagno"
"sfero"
"sfinkso"
"siatempe"
"siblado"
"sidejo"
"siesto"
"sifono"
"signalo"
"siklo"
"silenti"
"simpla"
"sinjoro"
"siropo"
"sistemo"
"situacio"
"siverto"
"sizifa"
"skatolo"
"skemo"
"skianto"
"sklavo"
"skorpio"
"skribisto"
"skulpti"
"skvamo"
"slango"
"sledeto"
"sliparo"
"smeraldo"
"smirgi"
"smokingo"
"smuto"
"snoba"
"snufegi"
"sobra"
"sociano"
"sodakvo"
"sofo"
"soifi"
"sojlo"
"soklo"
"soldato"
"somero"
"sonilo"
"sopiri"
"sorto"
"soulo"
"soveto"
"sparkado"
"speciala"
"spiri"
"splito"
"sporto"
"sprita"
"spuro"
"stabila"
"stelfiguro"
"stimulo"
"stomako"
"strato"
"studanto"
"subgrupo"
"suden"
"suferanta"
"sugesti"
"suito"
"sukero"
"sulko"
"sume"
"sunlumo"
"super"
"surskribeto"
"suspekti"
"suturo"
"svati"
"svenfali"
"svingi"
"svopo"
"tabako"
"taglumo"
"tajloro"
"taksimetro"
"talento"
"tamen"
"tanko"
"taoismo"
"tapioko"
"tarifo"
"tasko"
"tatui"
"taverno"
"teatro"
"tedlaboro"
"tegmento"
"tehoro"
"teknika"
"telefono"
"tempo"
"tenisejo"
"teorie"
"teraso"
"testudo"
"tetablo"
"teujo"
"tezo"
"tialo"
"tibio"
"tielnomata"
"tifono"
"tigro"
"tikli"
"timida"
"tinkturo"
"tiom"
"tiparo"
"tirkesto"
"titolo"
"tiutempe"
"tizano"
"tobogano"
"tofeo"
"togo"
"toksa"
"tolerema"
"tombolo"
"tondri"
"topografio"
"tordeti"
"tosti"
"totalo"
"traduko"
"tredi"
"triangulo"
"tropika"
"trumpeto"
"tualeto"
"tubisto"
"tufgrebo"
"tuja"
"tukano"
"tulipo"
"tumulto"
"tunelo"
"turisto"
"tusi"
"tutmonda"
"tvisto"
"udono"
"uesto"
"ukazo"
"ukelelo"
"ulcero"
"ulmo"
"ultimato"
"ululi"
"umbiliko"
"unco"
"ungego"
"uniformo"
"unkti"
"unukolora"
"uragano"
"urbano"
"uretro"
"urino"
"ursido"
"uskleco"
"usonigi"
"utero"
"utila"
"utopia"
"uverturo"
"uzadi"
"uzeblo"
"uzino"
"uzkutimo"
"uzofini"
"uzurpi"
"uzvaloro"
"vadejo"
"vafleto"
"vagono"
"vahabismo"
"vajco"
"vakcino"
"valoro"
"vampiro"
"vangharoj"
"vaporo"
"varma"
"vasta"
"vato"
"vazaro"
"veaspekta"
"vedismo"
"vegetalo"
"vehiklo"
"vejno"
"vekita"
"velstango"
"vemieno"
"vendi"
"vepro"
"verando"
"vespero"
"veturi"
"veziko"
"viando"
"vibri"
"vico"
"videbla"
"vifio"
"vigla"
"viktimo"
"vila"
"vimeno"
"vintro"
"violo"
"vippuno"
"virtuala"
"viskoza"
"vitro"
"viveca"
"viziti"
"vobli"
"vodko"
"vojeto"
"vokegi"
"volbo"
"vomema"
"vono"
"vortaro"
"vosto"
"voti"
"vrako"
"vringi"
"vualo"
"vulkano"
"vundo"
"vuvuzelo"
"zamenhofa"
"zapi"
"zebro"
"zefiro"
"zeloto"
"zenismo"
"zeolito"
"zepelino"
"zeto"
"zigzagi"
"zinko"
"zipo"
"zirkonio"
"zodiako"
"zoeto"
"zombio"
"zono"
"zoologio"
"zorgi"
"zukino"
"zumilo"))
| 43,251 | Common Lisp | .lisp | 1,633 | 8.548071 | 60 | 0.255755 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | f0167426caef0bf6dbc26b62c97ceac27a52db615cc826a876d4d6c138f0b260 | 8,081 | [
-1
] |
8,082 | english.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/english.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :english
3
#("abbey"
"abducts"
"ability"
"ablaze"
"abnormal"
"abort"
"abrasive"
"absorb"
"abyss"
"academy"
"aces"
"aching"
"acidic"
"acoustic"
"acquire"
"across"
"actress"
"acumen"
"adapt"
"addicted"
"adept"
"adhesive"
"adjust"
"adopt"
"adrenalin"
"adult"
"adventure"
"aerial"
"afar"
"affair"
"afield"
"afloat"
"afoot"
"afraid"
"after"
"against"
"agenda"
"aggravate"
"agile"
"aglow"
"agnostic"
"agony"
"agreed"
"ahead"
"aided"
"ailments"
"aimless"
"airport"
"aisle"
"ajar"
"akin"
"alarms"
"album"
"alchemy"
"alerts"
"algebra"
"alkaline"
"alley"
"almost"
"aloof"
"alpine"
"already"
"also"
"altitude"
"alumni"
"always"
"amaze"
"ambush"
"amended"
"amidst"
"ammo"
"amnesty"
"among"
"amply"
"amused"
"anchor"
"android"
"anecdote"
"angled"
"ankle"
"annoyed"
"answers"
"antics"
"anvil"
"anxiety"
"anybody"
"apart"
"apex"
"aphid"
"aplomb"
"apology"
"apply"
"apricot"
"aptitude"
"aquarium"
"arbitrary"
"archer"
"ardent"
"arena"
"argue"
"arises"
"army"
"around"
"arrow"
"arsenic"
"artistic"
"ascend"
"ashtray"
"aside"
"asked"
"asleep"
"aspire"
"assorted"
"asylum"
"athlete"
"atlas"
"atom"
"atrium"
"attire"
"auburn"
"auctions"
"audio"
"august"
"aunt"
"austere"
"autumn"
"avatar"
"avidly"
"avoid"
"awakened"
"awesome"
"awful"
"awkward"
"awning"
"awoken"
"axes"
"axis"
"axle"
"aztec"
"azure"
"baby"
"bacon"
"badge"
"baffles"
"bagpipe"
"bailed"
"bakery"
"balding"
"bamboo"
"banjo"
"baptism"
"basin"
"batch"
"bawled"
"bays"
"because"
"beer"
"befit"
"begun"
"behind"
"being"
"below"
"bemused"
"benches"
"berries"
"bested"
"betting"
"bevel"
"beware"
"beyond"
"bias"
"bicycle"
"bids"
"bifocals"
"biggest"
"bikini"
"bimonthly"
"binocular"
"biology"
"biplane"
"birth"
"biscuit"
"bite"
"biweekly"
"blender"
"blip"
"bluntly"
"boat"
"bobsled"
"bodies"
"bogeys"
"boil"
"boldly"
"bomb"
"border"
"boss"
"both"
"bounced"
"bovine"
"bowling"
"boxes"
"boyfriend"
"broken"
"brunt"
"bubble"
"buckets"
"budget"
"buffet"
"bugs"
"building"
"bulb"
"bumper"
"bunch"
"business"
"butter"
"buying"
"buzzer"
"bygones"
"byline"
"bypass"
"cabin"
"cactus"
"cadets"
"cafe"
"cage"
"cajun"
"cake"
"calamity"
"camp"
"candy"
"casket"
"catch"
"cause"
"cavernous"
"cease"
"cedar"
"ceiling"
"cell"
"cement"
"cent"
"certain"
"chlorine"
"chrome"
"cider"
"cigar"
"cinema"
"circle"
"cistern"
"citadel"
"civilian"
"claim"
"click"
"clue"
"coal"
"cobra"
"cocoa"
"code"
"coexist"
"coffee"
"cogs"
"cohesive"
"coils"
"colony"
"comb"
"cool"
"copy"
"corrode"
"costume"
"cottage"
"cousin"
"cowl"
"criminal"
"cube"
"cucumber"
"cuddled"
"cuffs"
"cuisine"
"cunning"
"cupcake"
"custom"
"cycling"
"cylinder"
"cynical"
"dabbing"
"dads"
"daft"
"dagger"
"daily"
"damp"
"dangerous"
"dapper"
"darted"
"dash"
"dating"
"dauntless"
"dawn"
"daytime"
"dazed"
"debut"
"decay"
"dedicated"
"deepest"
"deftly"
"degrees"
"dehydrate"
"deity"
"dejected"
"delayed"
"demonstrate"
"dented"
"deodorant"
"depth"
"desk"
"devoid"
"dewdrop"
"dexterity"
"dialect"
"dice"
"diet"
"different"
"digit"
"dilute"
"dime"
"dinner"
"diode"
"diplomat"
"directed"
"distance"
"ditch"
"divers"
"dizzy"
"doctor"
"dodge"
"does"
"dogs"
"doing"
"dolphin"
"domestic"
"donuts"
"doorway"
"dormant"
"dosage"
"dotted"
"double"
"dove"
"down"
"dozen"
"dreams"
"drinks"
"drowning"
"drunk"
"drying"
"dual"
"dubbed"
"duckling"
"dude"
"duets"
"duke"
"dullness"
"dummy"
"dunes"
"duplex"
"duration"
"dusted"
"duties"
"dwarf"
"dwelt"
"dwindling"
"dying"
"dynamite"
"dyslexic"
"each"
"eagle"
"earth"
"easy"
"eating"
"eavesdrop"
"eccentric"
"echo"
"eclipse"
"economics"
"ecstatic"
"eden"
"edgy"
"edited"
"educated"
"eels"
"efficient"
"eggs"
"egotistic"
"eight"
"either"
"eject"
"elapse"
"elbow"
"eldest"
"eleven"
"elite"
"elope"
"else"
"eluded"
"emails"
"ember"
"emerge"
"emit"
"emotion"
"empty"
"emulate"
"energy"
"enforce"
"enhanced"
"enigma"
"enjoy"
"enlist"
"enmity"
"enough"
"enraged"
"ensign"
"entrance"
"envy"
"epoxy"
"equip"
"erase"
"erected"
"erosion"
"error"
"eskimos"
"espionage"
"essential"
"estate"
"etched"
"eternal"
"ethics"
"etiquette"
"evaluate"
"evenings"
"evicted"
"evolved"
"examine"
"excess"
"exhale"
"exit"
"exotic"
"exquisite"
"extra"
"exult"
"fabrics"
"factual"
"fading"
"fainted"
"faked"
"fall"
"family"
"fancy"
"farming"
"fatal"
"faulty"
"fawns"
"faxed"
"fazed"
"feast"
"february"
"federal"
"feel"
"feline"
"females"
"fences"
"ferry"
"festival"
"fetches"
"fever"
"fewest"
"fiat"
"fibula"
"fictional"
"fidget"
"fierce"
"fifteen"
"fight"
"films"
"firm"
"fishing"
"fitting"
"five"
"fixate"
"fizzle"
"fleet"
"flippant"
"flying"
"foamy"
"focus"
"foes"
"foggy"
"foiled"
"folding"
"fonts"
"foolish"
"fossil"
"fountain"
"fowls"
"foxes"
"foyer"
"framed"
"friendly"
"frown"
"fruit"
"frying"
"fudge"
"fuel"
"fugitive"
"fully"
"fuming"
"fungal"
"furnished"
"fuselage"
"future"
"fuzzy"
"gables"
"gadget"
"gags"
"gained"
"galaxy"
"gambit"
"gang"
"gasp"
"gather"
"gauze"
"gave"
"gawk"
"gaze"
"gearbox"
"gecko"
"geek"
"gels"
"gemstone"
"general"
"geometry"
"germs"
"gesture"
"getting"
"geyser"
"ghetto"
"ghost"
"giant"
"giddy"
"gifts"
"gigantic"
"gills"
"gimmick"
"ginger"
"girth"
"giving"
"glass"
"gleeful"
"glide"
"gnaw"
"gnome"
"goat"
"goblet"
"godfather"
"goes"
"goggles"
"going"
"goldfish"
"gone"
"goodbye"
"gopher"
"gorilla"
"gossip"
"gotten"
"gourmet"
"governing"
"gown"
"greater"
"grunt"
"guarded"
"guest"
"guide"
"gulp"
"gumball"
"guru"
"gusts"
"gutter"
"guys"
"gymnast"
"gypsy"
"gyrate"
"habitat"
"hacksaw"
"haggled"
"hairy"
"hamburger"
"happens"
"hashing"
"hatchet"
"haunted"
"having"
"hawk"
"haystack"
"hazard"
"hectare"
"hedgehog"
"heels"
"hefty"
"height"
"hemlock"
"hence"
"heron"
"hesitate"
"hexagon"
"hickory"
"hiding"
"highway"
"hijack"
"hiker"
"hills"
"himself"
"hinder"
"hippo"
"hire"
"history"
"hitched"
"hive"
"hoax"
"hobby"
"hockey"
"hoisting"
"hold"
"honked"
"hookup"
"hope"
"hornet"
"hospital"
"hotel"
"hounded"
"hover"
"howls"
"hubcaps"
"huddle"
"huge"
"hull"
"humid"
"hunter"
"hurried"
"husband"
"huts"
"hybrid"
"hydrogen"
"hyper"
"iceberg"
"icing"
"icon"
"identity"
"idiom"
"idled"
"idols"
"igloo"
"ignore"
"iguana"
"illness"
"imagine"
"imbalance"
"imitate"
"impel"
"inactive"
"inbound"
"incur"
"industrial"
"inexact"
"inflamed"
"ingested"
"initiate"
"injury"
"inkling"
"inline"
"inmate"
"innocent"
"inorganic"
"input"
"inquest"
"inroads"
"insult"
"intended"
"inundate"
"invoke"
"inwardly"
"ionic"
"irate"
"iris"
"irony"
"irritate"
"island"
"isolated"
"issued"
"italics"
"itches"
"items"
"itinerary"
"itself"
"ivory"
"jabbed"
"jackets"
"jaded"
"jagged"
"jailed"
"jamming"
"january"
"jargon"
"jaunt"
"javelin"
"jaws"
"jazz"
"jeans"
"jeers"
"jellyfish"
"jeopardy"
"jerseys"
"jester"
"jetting"
"jewels"
"jigsaw"
"jingle"
"jittery"
"jive"
"jobs"
"jockey"
"jogger"
"joining"
"joking"
"jolted"
"jostle"
"journal"
"joyous"
"jubilee"
"judge"
"juggled"
"juicy"
"jukebox"
"july"
"jump"
"junk"
"jury"
"justice"
"juvenile"
"kangaroo"
"karate"
"keep"
"kennel"
"kept"
"kernels"
"kettle"
"keyboard"
"kickoff"
"kidneys"
"king"
"kiosk"
"kisses"
"kitchens"
"kiwi"
"knapsack"
"knee"
"knife"
"knowledge"
"knuckle"
"koala"
"laboratory"
"ladder"
"lagoon"
"lair"
"lakes"
"lamb"
"language"
"laptop"
"large"
"last"
"later"
"launching"
"lava"
"lawsuit"
"layout"
"lazy"
"lectures"
"ledge"
"leech"
"left"
"legion"
"leisure"
"lemon"
"lending"
"leopard"
"lesson"
"lettuce"
"lexicon"
"liar"
"library"
"licks"
"lids"
"lied"
"lifestyle"
"light"
"likewise"
"lilac"
"limits"
"linen"
"lion"
"lipstick"
"liquid"
"listen"
"lively"
"loaded"
"lobster"
"locker"
"lodge"
"lofty"
"logic"
"loincloth"
"long"
"looking"
"lopped"
"lordship"
"losing"
"lottery"
"loudly"
"love"
"lower"
"loyal"
"lucky"
"luggage"
"lukewarm"
"lullaby"
"lumber"
"lunar"
"lurk"
"lush"
"luxury"
"lymph"
"lynx"
"lyrics"
"macro"
"madness"
"magically"
"mailed"
"major"
"makeup"
"malady"
"mammal"
"maps"
"masterful"
"match"
"maul"
"maverick"
"maximum"
"mayor"
"maze"
"meant"
"mechanic"
"medicate"
"meeting"
"megabyte"
"melting"
"memoir"
"menu"
"merger"
"mesh"
"metro"
"mews"
"mice"
"midst"
"mighty"
"mime"
"mirror"
"misery"
"mittens"
"mixture"
"moat"
"mobile"
"mocked"
"mohawk"
"moisture"
"molten"
"moment"
"money"
"moon"
"mops"
"morsel"
"mostly"
"motherly"
"mouth"
"movement"
"mowing"
"much"
"muddy"
"muffin"
"mugged"
"mullet"
"mumble"
"mundane"
"muppet"
"mural"
"musical"
"muzzle"
"myriad"
"mystery"
"myth"
"nabbing"
"nagged"
"nail"
"names"
"nanny"
"napkin"
"narrate"
"nasty"
"natural"
"nautical"
"navy"
"nearby"
"necklace"
"needed"
"negative"
"neither"
"neon"
"nephew"
"nerves"
"nestle"
"network"
"neutral"
"never"
"newt"
"nexus"
"nibs"
"niche"
"niece"
"nifty"
"nightly"
"nimbly"
"nineteen"
"nirvana"
"nitrogen"
"nobody"
"nocturnal"
"nodes"
"noises"
"nomad"
"noodles"
"northern"
"nostril"
"noted"
"nouns"
"novelty"
"nowhere"
"nozzle"
"nuance"
"nucleus"
"nudged"
"nugget"
"nuisance"
"null"
"number"
"nuns"
"nurse"
"nutshell"
"nylon"
"oaks"
"oars"
"oasis"
"oatmeal"
"obedient"
"object"
"obliged"
"obnoxious"
"observant"
"obtains"
"obvious"
"occur"
"ocean"
"october"
"odds"
"odometer"
"offend"
"often"
"oilfield"
"ointment"
"okay"
"older"
"olive"
"olympics"
"omega"
"omission"
"omnibus"
"onboard"
"oncoming"
"oneself"
"ongoing"
"onion"
"online"
"onslaught"
"onto"
"onward"
"oozed"
"opacity"
"opened"
"opposite"
"optical"
"opus"
"orange"
"orbit"
"orchid"
"orders"
"organs"
"origin"
"ornament"
"orphans"
"oscar"
"ostrich"
"otherwise"
"otter"
"ouch"
"ought"
"ounce"
"ourselves"
"oust"
"outbreak"
"oval"
"oven"
"owed"
"owls"
"owner"
"oxidant"
"oxygen"
"oyster"
"ozone"
"pact"
"paddles"
"pager"
"pairing"
"palace"
"pamphlet"
"pancakes"
"paper"
"paradise"
"pastry"
"patio"
"pause"
"pavements"
"pawnshop"
"payment"
"peaches"
"pebbles"
"peculiar"
"pedantic"
"peeled"
"pegs"
"pelican"
"pencil"
"people"
"pepper"
"perfect"
"pests"
"petals"
"phase"
"pheasants"
"phone"
"phrases"
"physics"
"piano"
"picked"
"pierce"
"pigment"
"piloted"
"pimple"
"pinched"
"pioneer"
"pipeline"
"pirate"
"pistons"
"pitched"
"pivot"
"pixels"
"pizza"
"playful"
"pledge"
"pliers"
"plotting"
"plus"
"plywood"
"poaching"
"pockets"
"podcast"
"poetry"
"point"
"poker"
"polar"
"ponies"
"pool"
"popular"
"portents"
"possible"
"potato"
"pouch"
"poverty"
"powder"
"pram"
"present"
"pride"
"problems"
"pruned"
"prying"
"psychic"
"public"
"puck"
"puddle"
"puffin"
"pulp"
"pumpkins"
"punch"
"puppy"
"purged"
"push"
"putty"
"puzzled"
"pylons"
"pyramid"
"python"
"queen"
"quick"
"quote"
"rabbits"
"racetrack"
"radar"
"rafts"
"rage"
"railway"
"raking"
"rally"
"ramped"
"randomly"
"rapid"
"rarest"
"rash"
"rated"
"ravine"
"rays"
"razor"
"react"
"rebel"
"recipe"
"reduce"
"reef"
"refer"
"regular"
"reheat"
"reinvest"
"rejoices"
"rekindle"
"relic"
"remedy"
"renting"
"reorder"
"repent"
"request"
"reruns"
"rest"
"return"
"reunion"
"revamp"
"rewind"
"rhino"
"rhythm"
"ribbon"
"richly"
"ridges"
"rift"
"rigid"
"rims"
"ringing"
"riots"
"ripped"
"rising"
"ritual"
"river"
"roared"
"robot"
"rockets"
"rodent"
"rogue"
"roles"
"romance"
"roomy"
"roped"
"roster"
"rotate"
"rounded"
"rover"
"rowboat"
"royal"
"ruby"
"rudely"
"ruffled"
"rugged"
"ruined"
"ruling"
"rumble"
"runway"
"rural"
"rustled"
"ruthless"
"sabotage"
"sack"
"sadness"
"safety"
"saga"
"sailor"
"sake"
"salads"
"sample"
"sanity"
"sapling"
"sarcasm"
"sash"
"satin"
"saucepan"
"saved"
"sawmill"
"saxophone"
"sayings"
"scamper"
"scenic"
"school"
"science"
"scoop"
"scrub"
"scuba"
"seasons"
"second"
"sedan"
"seeded"
"segments"
"seismic"
"selfish"
"semifinal"
"sensible"
"september"
"sequence"
"serving"
"session"
"setup"
"seventh"
"sewage"
"shackles"
"shelter"
"shipped"
"shocking"
"shrugged"
"shuffled"
"shyness"
"siblings"
"sickness"
"sidekick"
"sieve"
"sifting"
"sighting"
"silk"
"simplest"
"sincerely"
"sipped"
"siren"
"situated"
"sixteen"
"sizes"
"skater"
"skew"
"skirting"
"skulls"
"skydive"
"slackens"
"sleepless"
"slid"
"slower"
"slug"
"smash"
"smelting"
"smidgen"
"smog"
"smuggled"
"snake"
"sneeze"
"sniff"
"snout"
"snug"
"soapy"
"sober"
"soccer"
"soda"
"software"
"soggy"
"soil"
"solved"
"somewhere"
"sonic"
"soothe"
"soprano"
"sorry"
"southern"
"sovereign"
"sowed"
"soya"
"space"
"speedy"
"sphere"
"spiders"
"splendid"
"spout"
"sprig"
"spud"
"spying"
"square"
"stacking"
"stellar"
"stick"
"stockpile"
"strained"
"stunning"
"stylishly"
"subtly"
"succeed"
"suddenly"
"suede"
"suffice"
"sugar"
"suitcase"
"sulking"
"summon"
"sunken"
"superior"
"surfer"
"sushi"
"suture"
"swagger"
"swept"
"swiftly"
"sword"
"swung"
"syllabus"
"symptoms"
"syndrome"
"syringe"
"system"
"taboo"
"tacit"
"tadpoles"
"tagged"
"tail"
"taken"
"talent"
"tamper"
"tanks"
"tapestry"
"tarnished"
"tasked"
"tattoo"
"taunts"
"tavern"
"tawny"
"taxi"
"teardrop"
"technical"
"tedious"
"teeming"
"tell"
"template"
"tender"
"tepid"
"tequila"
"terminal"
"testing"
"tether"
"textbook"
"thaw"
"theatrics"
"thirsty"
"thorn"
"threaten"
"thumbs"
"thwart"
"ticket"
"tidy"
"tiers"
"tiger"
"tilt"
"timber"
"tinted"
"tipsy"
"tirade"
"tissue"
"titans"
"toaster"
"tobacco"
"today"
"toenail"
"toffee"
"together"
"toilet"
"token"
"tolerant"
"tomorrow"
"tonic"
"toolbox"
"topic"
"torch"
"tossed"
"total"
"touchy"
"towel"
"toxic"
"toyed"
"trash"
"trendy"
"tribal"
"trolling"
"truth"
"trying"
"tsunami"
"tubes"
"tucks"
"tudor"
"tuesday"
"tufts"
"tugs"
"tuition"
"tulips"
"tumbling"
"tunnel"
"turnip"
"tusks"
"tutor"
"tuxedo"
"twang"
"tweezers"
"twice"
"twofold"
"tycoon"
"typist"
"tyrant"
"ugly"
"ulcers"
"ultimate"
"umbrella"
"umpire"
"unafraid"
"unbending"
"uncle"
"under"
"uneven"
"unfit"
"ungainly"
"unhappy"
"union"
"unjustly"
"unknown"
"unlikely"
"unmask"
"unnoticed"
"unopened"
"unplugs"
"unquoted"
"unrest"
"unsafe"
"until"
"unusual"
"unveil"
"unwind"
"unzip"
"upbeat"
"upcoming"
"update"
"upgrade"
"uphill"
"upkeep"
"upload"
"upon"
"upper"
"upright"
"upstairs"
"uptight"
"upwards"
"urban"
"urchins"
"urgent"
"usage"
"useful"
"usher"
"using"
"usual"
"utensils"
"utility"
"utmost"
"utopia"
"uttered"
"vacation"
"vague"
"vain"
"value"
"vampire"
"vane"
"vapidly"
"vary"
"vastness"
"vats"
"vaults"
"vector"
"veered"
"vegan"
"vehicle"
"vein"
"velvet"
"venomous"
"verification"
"vessel"
"veteran"
"vexed"
"vials"
"vibrate"
"victim"
"video"
"viewpoint"
"vigilant"
"viking"
"village"
"vinegar"
"violin"
"vipers"
"virtual"
"visited"
"vitals"
"vivid"
"vixen"
"vocal"
"vogue"
"voice"
"volcano"
"vortex"
"voted"
"voucher"
"vowels"
"voyage"
"vulture"
"wade"
"waffle"
"wagtail"
"waist"
"waking"
"wallets"
"wanted"
"warped"
"washing"
"water"
"waveform"
"waxing"
"wayside"
"weavers"
"website"
"wedge"
"weekday"
"weird"
"welders"
"went"
"wept"
"were"
"western"
"wetsuit"
"whale"
"when"
"whipped"
"whole"
"wickets"
"width"
"wield"
"wife"
"wiggle"
"wildly"
"winter"
"wipeout"
"wiring"
"wise"
"withdrawn"
"wives"
"wizard"
"wobbly"
"woes"
"woken"
"wolf"
"womanly"
"wonders"
"woozy"
"worry"
"wounded"
"woven"
"wrap"
"wrist"
"wrong"
"yacht"
"yahoo"
"yanks"
"yard"
"yawning"
"yearbook"
"yellow"
"yesterday"
"yeti"
"yields"
"yodel"
"yoga"
"younger"
"yoyo"
"zapped"
"zeal"
"zebra"
"zero"
"zesty"
"zigzags"
"zinger"
"zippers"
"zodiac"
"zombie"
"zones"
"zoom"))
| 42,630 | Common Lisp | .lisp | 1,633 | 8.167789 | 60 | 0.244481 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | fc177bd1558cd92f362b460f1484a4aa8cbc64936f9e6b6813e9cbf940cef22b | 8,082 | [
-1
] |
8,083 | lojban.lisp | glv2_cl-monero-tools/monero-tools/mnemonic/lojban.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2017 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(add-word-list :lojban
4
#("backi"
"bacru"
"badna"
"badri"
"bajra"
"bakfu"
"bakni"
"bakri"
"baktu"
"balji"
"balni"
"balre"
"balvi"
"bambu"
"bancu"
"bandu"
"banfi"
"bangu"
"banli"
"banro"
"banxa"
"banzu"
"bapli"
"barda"
"bargu"
"barja"
"barna"
"bartu"
"basfa"
"basna"
"basti"
"batci"
"batke"
"bavmi"
"baxso"
"bebna"
"bekpi"
"bemro"
"bende"
"bengo"
"benji"
"benre"
"benzo"
"bergu"
"bersa"
"berti"
"besna"
"besto"
"betfu"
"betri"
"bevri"
"bidju"
"bifce"
"bikla"
"bilga"
"bilma"
"bilni"
"bindo"
"binra"
"binxo"
"birje"
"birka"
"birti"
"bisli"
"bitmu"
"bitni"
"blabi"
"blaci"
"blanu"
"bliku"
"bloti"
"bolci"
"bongu"
"boske"
"botpi"
"boxfo"
"boxna"
"bradi"
"brano"
"bratu"
"brazo"
"bredi"
"bridi"
"brife"
"briju"
"brito"
"brivo"
"broda"
"bruna"
"budjo"
"bukpu"
"bumru"
"bunda"
"bunre"
"burcu"
"burna"
"cabna"
"cabra"
"cacra"
"cadga"
"cadzu"
"cafne"
"cagna"
"cakla"
"calku"
"calse"
"canci"
"cando"
"cange"
"canja"
"canko"
"canlu"
"canpa"
"canre"
"canti"
"carce"
"carfu"
"carmi"
"carna"
"cartu"
"carvi"
"casnu"
"catke"
"catlu"
"catni"
"catra"
"caxno"
"cecla"
"cecmu"
"cedra"
"cenba"
"censa"
"centi"
"cerda"
"cerni"
"certu"
"cevni"
"cfale"
"cfari"
"cfika"
"cfila"
"cfine"
"cfipu"
"ciblu"
"cicna"
"cidja"
"cidni"
"cidro"
"cifnu"
"cigla"
"cikna"
"cikre"
"ciksi"
"cilce"
"cilfu"
"cilmo"
"cilre"
"cilta"
"cimde"
"cimni"
"cinba"
"cindu"
"cinfo"
"cinje"
"cinki"
"cinla"
"cinmo"
"cinri"
"cinse"
"cinta"
"cinza"
"cipni"
"cipra"
"cirko"
"cirla"
"ciska"
"cisma"
"cisni"
"ciste"
"citka"
"citno"
"citri"
"citsi"
"civla"
"cizra"
"ckabu"
"ckafi"
"ckaji"
"ckana"
"ckape"
"ckasu"
"ckeji"
"ckiku"
"ckilu"
"ckini"
"ckire"
"ckule"
"ckunu"
"cladu"
"clani"
"claxu"
"cletu"
"clika"
"clinu"
"clira"
"clite"
"cliva"
"clupa"
"cmaci"
"cmalu"
"cmana"
"cmavo"
"cmene"
"cmeta"
"cmevo"
"cmila"
"cmima"
"cmoni"
"cnano"
"cnebo"
"cnemu"
"cnici"
"cnino"
"cnisa"
"cnita"
"cokcu"
"condi"
"conka"
"corci"
"cortu"
"cpacu"
"cpana"
"cpare"
"cpedu"
"cpina"
"cradi"
"crane"
"creka"
"crepu"
"cribe"
"crida"
"crino"
"cripu"
"crisa"
"critu"
"ctaru"
"ctebi"
"cteki"
"ctile"
"ctino"
"ctuca"
"cukla"
"cukre"
"cukta"
"culno"
"cumki"
"cumla"
"cunmi"
"cunso"
"cuntu"
"cupra"
"curmi"
"curnu"
"curve"
"cusku"
"cusna"
"cutci"
"cutne"
"cuxna"
"dacru"
"dacti"
"dadjo"
"dakfu"
"dakli"
"damba"
"damri"
"dandu"
"danfu"
"danlu"
"danmo"
"danre"
"dansu"
"danti"
"daplu"
"dapma"
"darca"
"dargu"
"darlu"
"darno"
"darsi"
"darxi"
"daski"
"dasni"
"daspo"
"dasri"
"datka"
"datni"
"datro"
"decti"
"degji"
"dejni"
"dekpu"
"dekto"
"delno"
"dembi"
"denci"
"denmi"
"denpa"
"dertu"
"derxi"
"desku"
"detri"
"dicma"
"dicra"
"didni"
"digno"
"dikca"
"diklo"
"dikni"
"dilcu"
"dilma"
"dilnu"
"dimna"
"dindi"
"dinju"
"dinko"
"dinso"
"dirba"
"dirce"
"dirgo"
"disko"
"ditcu"
"divzi"
"dizlo"
"djacu"
"djedi"
"djica"
"djine"
"djuno"
"donri"
"dotco"
"draci"
"drani"
"drata"
"drudi"
"dugri"
"dukse"
"dukti"
"dunda"
"dunja"
"dunku"
"dunli"
"dunra"
"dutso"
"dzena"
"dzipo"
"facki"
"fadni"
"fagri"
"falnu"
"famti"
"fancu"
"fange"
"fanmo"
"fanri"
"fanta"
"fanva"
"fanza"
"fapro"
"farka"
"farlu"
"farna"
"farvi"
"fasnu"
"fatci"
"fatne"
"fatri"
"febvi"
"fegli"
"femti"
"fendi"
"fengu"
"fenki"
"fenra"
"fenso"
"fepni"
"fepri"
"ferti"
"festi"
"fetsi"
"figre"
"filso"
"finpe"
"finti"
"firca"
"fisli"
"fizbu"
"flaci"
"flalu"
"flani"
"flecu"
"flese"
"fliba"
"flira"
"foldi"
"fonmo"
"fonxa"
"forca"
"forse"
"fraso"
"frati"
"fraxu"
"frica"
"friko"
"frili"
"frinu"
"friti"
"frumu"
"fukpi"
"fulta"
"funca"
"fusra"
"fuzme"
"gacri"
"gadri"
"galfi"
"galtu"
"galxe"
"ganlo"
"ganra"
"ganse"
"ganti"
"ganxo"
"ganzu"
"gapci"
"gapru"
"garna"
"gasnu"
"gaspo"
"gasta"
"genja"
"gento"
"genxu"
"gerku"
"gerna"
"gidva"
"gigdo"
"ginka"
"girzu"
"gismu"
"glare"
"gleki"
"gletu"
"glico"
"glife"
"glosa"
"gluta"
"gocti"
"gomsi"
"gotro"
"gradu"
"grafu"
"grake"
"grana"
"grasu"
"grava"
"greku"
"grusi"
"grute"
"gubni"
"gugde"
"gugle"
"gumri"
"gundi"
"gunka"
"gunma"
"gunro"
"gunse"
"gunta"
"gurni"
"guska"
"gusni"
"gusta"
"gutci"
"gutra"
"guzme"
"jabre"
"jadni"
"jakne"
"jalge"
"jalna"
"jalra"
"jamfu"
"jamna"
"janbe"
"janco"
"janli"
"jansu"
"janta"
"jarbu"
"jarco"
"jarki"
"jaspu"
"jatna"
"javni"
"jbama"
"jbari"
"jbena"
"jbera"
"jbini"
"jdari"
"jdice"
"jdika"
"jdima"
"jdini"
"jduli"
"jecta"
"jeftu"
"jegvo"
"jelca"
"jemna"
"jenca"
"jendu"
"jenmi"
"jensi"
"jerna"
"jersi"
"jerxo"
"jesni"
"jetce"
"jetnu"
"jgalu"
"jganu"
"jgari"
"jgena"
"jgina"
"jgira"
"jgita"
"jibni"
"jibri"
"jicla"
"jicmu"
"jijnu"
"jikca"
"jikfi"
"jikni"
"jikru"
"jilka"
"jilra"
"jimca"
"jimpe"
"jimte"
"jinci"
"jinda"
"jinga"
"jinku"
"jinme"
"jinru"
"jinsa"
"jinto"
"jinvi"
"jinzi"
"jipci"
"jipno"
"jirna"
"jisra"
"jitfa"
"jitro"
"jivbu"
"jivna"
"jmaji"
"jmifa"
"jmina"
"jmive"
"jonse"
"jordo"
"jorne"
"jubme"
"judri"
"jufra"
"jukni"
"jukpa"
"julne"
"julro"
"jundi"
"jungo"
"junla"
"junri"
"junta"
"jurme"
"jursa"
"jutsi"
"juxre"
"jvinu"
"jviso"
"kabri"
"kacma"
"kadno"
"kafke"
"kagni"
"kajde"
"kajna"
"kakne"
"kakpa"
"kalci"
"kalri"
"kalsa"
"kalte"
"kamju"
"kamni"
"kampu"
"kamre"
"kanba"
"kancu"
"kandi"
"kanji"
"kanla"
"kanpe"
"kanro"
"kansa"
"kantu"
"kanxe"
"karbi"
"karce"
"karda"
"kargu"
"karli"
"karni"
"katci"
"katna"
"kavbu"
"kazra"
"kecti"
"kekli"
"kelci"
"kelvo"
"kenka"
"kenra"
"kensa"
"kerfa"
"kerlo"
"kesri"
"ketco"
"ketsu"
"kevna"
"kibro"
"kicne"
"kijno"
"kilto"
"kinda"
"kinli"
"kisto"
"klaji"
"klaku"
"klama"
"klani"
"klesi"
"kliki"
"klina"
"kliru"
"kliti"
"klupe"
"kluza"
"kobli"
"kogno"
"kojna"
"kokso"
"kolme"
"komcu"
"konju"
"korbi"
"korcu"
"korka"
"korvo"
"kosmu"
"kosta"
"krali"
"kramu"
"krasi"
"krati"
"krefu"
"krici"
"krili"
"krinu"
"krixa"
"kruca"
"kruji"
"kruvi"
"kubli"
"kucli"
"kufra"
"kukte"
"kulnu"
"kumfa"
"kumte"
"kunra"
"kunti"
"kurfa"
"kurji"
"kurki"
"kuspe"
"kusru"
"labno"
"lacni"
"lacpu"
"lacri"
"ladru"
"lafti"
"lakne"
"lakse"
"laldo"
"lalxu"
"lamji"
"lanbi"
"lanci"
"landa"
"lanka"
"lanli"
"lanme"
"lante"
"lanxe"
"lanzu"
"larcu"
"larva"
"lasna"
"lastu"
"latmo"
"latna"
"lazni"
"lebna"
"lelxe"
"lenga"
"lenjo"
"lenku"
"lerci"
"lerfu"
"libjo"
"lidne"
"lifri"
"lijda"
"limfa"
"limna"
"lince"
"lindi"
"linga"
"linji"
"linsi"
"linto"
"lisri"
"liste"
"litce"
"litki"
"litru"
"livga"
"livla"
"logji"
"loglo"
"lojbo"
"loldi"
"lorxu"
"lubno"
"lujvo"
"luksi"
"lumci"
"lunbe"
"lunra"
"lunsa"
"luska"
"lusto"
"mabla"
"mabru"
"macnu"
"majga"
"makcu"
"makfa"
"maksi"
"malsi"
"mamta"
"manci"
"manfo"
"mango"
"manku"
"manri"
"mansa"
"manti"
"mapku"
"mapni"
"mapra"
"mapti"
"marbi"
"marce"
"marde"
"margu"
"marji"
"marna"
"marxa"
"masno"
"masti"
"matci"
"matli"
"matne"
"matra"
"mavji"
"maxri"
"mebri"
"megdo"
"mekso"
"melbi"
"meljo"
"melmi"
"menli"
"menre"
"mensi"
"mentu"
"merko"
"merli"
"metfo"
"mexno"
"midju"
"mifra"
"mikce"
"mikri"
"milti"
"milxe"
"minde"
"minji"
"minli"
"minra"
"mintu"
"mipri"
"mirli"
"misno"
"misro"
"mitre"
"mixre"
"mlana"
"mlatu"
"mleca"
"mledi"
"mluni"
"mogle"
"mokca"
"moklu"
"molki"
"molro"
"morji"
"morko"
"morna"
"morsi"
"mosra"
"mraji"
"mrilu"
"mruli"
"mucti"
"mudri"
"mugle"
"mukti"
"mulno"
"munje"
"mupli"
"murse"
"murta"
"muslo"
"mutce"
"muvdu"
"muzga"
"nabmi"
"nakni"
"nalci"
"namcu"
"nanba"
"nanca"
"nandu"
"nanla"
"nanmu"
"nanvi"
"narge"
"narju"
"natfe"
"natmi"
"natsi"
"navni"
"naxle"
"nazbi"
"nejni"
"nelci"
"nenri"
"nerde"
"nibli"
"nicfa"
"nicte"
"nikle"
"nilce"
"nimre"
"ninja"
"ninmu"
"nirna"
"nitcu"
"nivji"
"nixli"
"nobli"
"norgo"
"notci"
"nudle"
"nukni"
"nunmu"
"nupre"
"nurma"
"nusna"
"nutka"
"nutli"
"nuzba"
"nuzlo"
"pacna"
"pagbu"
"pagre"
"pajni"
"palci"
"palku"
"palma"
"palne"
"palpi"
"palta"
"pambe"
"pamga"
"panci"
"pandi"
"panje"
"panka"
"panlo"
"panpi"
"panra"
"pante"
"panzi"
"papri"
"parbi"
"pardu"
"parji"
"pastu"
"patfu"
"patlu"
"patxu"
"paznu"
"pelji"
"pelxu"
"pemci"
"penbi"
"pencu"
"pendo"
"penmi"
"pensi"
"pentu"
"perli"
"pesxu"
"petso"
"pevna"
"pezli"
"picti"
"pijne"
"pikci"
"pikta"
"pilda"
"pilji"
"pilka"
"pilno"
"pimlu"
"pinca"
"pindi"
"pinfu"
"pinji"
"pinka"
"pinsi"
"pinta"
"pinxe"
"pipno"
"pixra"
"plana"
"platu"
"pleji"
"plibu"
"plini"
"plipe"
"plise"
"plita"
"plixa"
"pluja"
"pluka"
"pluta"
"pocli"
"polje"
"polno"
"ponjo"
"ponse"
"poplu"
"porpi"
"porsi"
"porto"
"prali"
"prami"
"prane"
"preja"
"prenu"
"preri"
"preti"
"prije"
"prina"
"pritu"
"proga"
"prosa"
"pruce"
"pruni"
"pruri"
"pruxi"
"pulce"
"pulji"
"pulni"
"punji"
"punli"
"pupsu"
"purci"
"purdi"
"purmo"
"racli"
"ractu"
"radno"
"rafsi"
"ragbi"
"ragve"
"rakle"
"rakso"
"raktu"
"ralci"
"ralju"
"ralte"
"randa"
"rango"
"ranji"
"ranmi"
"ransu"
"ranti"
"ranxi"
"rapli"
"rarna"
"ratcu"
"ratni"
"rebla"
"rectu"
"rekto"
"remna"
"renro"
"renvi"
"respa"
"rexsa"
"ricfu"
"rigni"
"rijno"
"rilti"
"rimni"
"rinci"
"rindo"
"rinju"
"rinka"
"rinsa"
"rirci"
"rirni"
"rirxe"
"rismi"
"risna"
"ritli"
"rivbi"
"rokci"
"romge"
"romlo"
"ronte"
"ropno"
"rorci"
"rotsu"
"rozgu"
"ruble"
"rufsu"
"runme"
"runta"
"rupnu"
"rusko"
"rutni"
"sabji"
"sabnu"
"sacki"
"saclu"
"sadjo"
"sakci"
"sakli"
"sakta"
"salci"
"salpo"
"salri"
"salta"
"samcu"
"sampu"
"sanbu"
"sance"
"sanga"
"sanji"
"sanli"
"sanmi"
"sanso"
"santa"
"sarcu"
"sarji"
"sarlu"
"sarni"
"sarxe"
"saske"
"satci"
"satre"
"savru"
"sazri"
"sefsi"
"sefta"
"sekre"
"selci"
"selfu"
"semto"
"senci"
"sengi"
"senpi"
"senta"
"senva"
"sepli"
"serti"
"sesre"
"setca"
"sevzi"
"sfani"
"sfasa"
"sfofa"
"sfubu"
"sibli"
"siclu"
"sicni"
"sicpi"
"sidbo"
"sidju"
"sigja"
"sigma"
"sikta"
"silka"
"silna"
"simlu"
"simsa"
"simxu"
"since"
"sinma"
"sinso"
"sinxa"
"sipna"
"sirji"
"sirxo"
"sisku"
"sisti"
"sitna"
"sivni"
"skaci"
"skami"
"skapi"
"skari"
"skicu"
"skiji"
"skina"
"skori"
"skoto"
"skuba"
"skuro"
"slabu"
"slaka"
"slami"
"slanu"
"slari"
"slasi"
"sligu"
"slilu"
"sliri"
"slovo"
"sluji"
"sluni"
"smacu"
"smadi"
"smaji"
"smaka"
"smani"
"smela"
"smoka"
"smuci"
"smuni"
"smusu"
"snada"
"snanu"
"snidu"
"snime"
"snipa"
"snuji"
"snura"
"snuti"
"sobde"
"sodna"
"sodva"
"softo"
"solji"
"solri"
"sombo"
"sonci"
"sorcu"
"sorgu"
"sorni"
"sorta"
"sovda"
"spaji"
"spali"
"spano"
"spati"
"speni"
"spero"
"spisa"
"spita"
"spofu"
"spoja"
"spuda"
"sputu"
"sraji"
"sraku"
"sralo"
"srana"
"srasu"
"srera"
"srito"
"sruma"
"sruri"
"stace"
"stagi"
"staku"
"stali"
"stani"
"stapa"
"stasu"
"stati"
"steba"
"steci"
"stedu"
"stela"
"stero"
"stici"
"stidi"
"stika"
"stizu"
"stodi"
"stuna"
"stura"
"stuzi"
"sucta"
"sudga"
"sufti"
"suksa"
"sumji"
"sumne"
"sumti"
"sunga"
"sunla"
"surla"
"sutra"
"tabno"
"tabra"
"tadji"
"tadni"
"tagji"
"taksi"
"talsa"
"tamca"
"tamji"
"tamne"
"tanbo"
"tance"
"tanjo"
"tanko"
"tanru"
"tansi"
"tanxe"
"tapla"
"tarbi"
"tarci"
"tarla"
"tarmi"
"tarti"
"taske"
"tasmi"
"tasta"
"tatpi"
"tatru"
"tavla"
"taxfu"
"tcaci"
"tcadu"
"tcana"
"tcati"
"tcaxe"
"tcena"
"tcese"
"tcica"
"tcidu"
"tcika"
"tcila"
"tcima"
"tcini"
"tcita"
"temci"
"temse"
"tende"
"tenfa"
"tengu"
"terdi"
"terpa"
"terto"
"tifri"
"tigni"
"tigra"
"tikpa"
"tilju"
"tinbe"
"tinci"
"tinsa"
"tirna"
"tirse"
"tirxu"
"tisna"
"titla"
"tivni"
"tixnu"
"toknu"
"toldi"
"tonga"
"tordu"
"torni"
"torso"
"traji"
"trano"
"trati"
"trene"
"tricu"
"trina"
"trixe"
"troci"
"tsaba"
"tsali"
"tsani"
"tsapi"
"tsiju"
"tsina"
"tsuku"
"tubnu"
"tubra"
"tugni"
"tujli"
"tumla"
"tunba"
"tunka"
"tunlo"
"tunta"
"tuple"
"turko"
"turni"
"tutci"
"tutle"
"tutra"
"vacri"
"vajni"
"valsi"
"vamji"
"vamtu"
"vanbi"
"vanci"
"vanju"
"vasru"
"vasxu"
"vecnu"
"vedli"
"venfu"
"vensa"
"vente"
"vepre"
"verba"
"vibna"
"vidni"
"vidru"
"vifne"
"vikmi"
"viknu"
"vimcu"
"vindu"
"vinji"
"vinta"
"vipsi"
"virnu"
"viska"
"vitci"
"vitke"
"vitno"
"vlagi"
"vlile"
"vlina"
"vlipa"
"vofli"
"voksa"
"volve"
"vorme"
"vraga"
"vreji"
"vreta"
"vrici"
"vrude"
"vrusi"
"vubla"
"vujnu"
"vukna"
"vukro"
"xabju"
"xadba"
"xadji"
"xadni"
"xagji"
"xagri"
"xajmi"
"xaksu"
"xalbo"
"xalka"
"xalni"
"xamgu"
"xampo"
"xamsi"
"xance"
"xango"
"xanka"
"xanri"
"xansa"
"xanto"
"xarci"
"xarju"
"xarnu"
"xasli"
"xasne"
"xatra"
"xatsi"
"xazdo"
"xebni"
"xebro"
"xecto"
"xedja"
"xekri"
"xelso"
"xendo"
"xenru"
"xexso"
"xigzo"
"xindo"
"xinmo"
"xirma"
"xislu"
"xispo"
"xlali"
"xlura"
"xorbo"
"xorlo"
"xotli"
"xrabo"
"xrani"
"xriso"
"xrotu"
"xruba"
"xruki"
"xrula"
"xruti"
"xukmi"
"xulta"
"xunre"
"xurdo"
"xusra"
"xutla"
"zabna"
"zajba"
"zalvi"
"zanru"
"zarci"
"zargu"
"zasni"
"zasti"
"zbabu"
"zbani"
"zbasu"
"zbepi"
"zdani"
"zdile"
"zekri"
"zenba"
"zepti"
"zetro"
"zevla"
"zgadi"
"zgana"
"zgike"
"zifre"
"zinki"
"zirpu"
"zivle"
"zmadu"
"zmiku"
"zucna"
"zukte"
"zumri"
"zungi"
"zunle"
"zunti"
"zutse"
"zvati"
"zviki"
"jbobau"
"jbopre"
"karsna"
"cabdei"
"zunsna"
"gendra"
"glibau"
"nintadni"
"pavyseljirna"
"vlaste"
"selbri"
"latro'a"
"zdakemkulgu'a"
"mriste"
"selsku"
"fu'ivla"
"tolmo'i"
"snavei"
"xagmau"
"retsku"
"ckupau"
"skudji"
"smudra"
"prulamdei"
"vokta'a"
"tinju'i"
"jefyfa'o"
"bavlamdei"
"kinzga"
"jbocre"
"jbovla"
"xauzma"
"selkei"
"xuncku"
"spusku"
"jbogu'e"
"pampe'o"
"bripre"
"jbosnu"
"zi'evla"
"gimste"
"tolzdi"
"velski"
"samselpla"
"cnegau"
"velcki"
"selja'e"
"fasybau"
"zanfri"
"reisku"
"favgau"
"jbota'a"
"rejgau"
"malgli"
"zilkai"
"keidji"
"tersu'i"
"jbofi'e"
"cnima'o"
"mulgau"
"ningau"
"ponbau"
"mrobi'o"
"rarbau"
"zmanei"
"famyma'o"
"vacysai"
"jetmlu"
"jbonunsla"
"nunpe'i"
"fa'orma'o"
"crezenzu'e"
"jbojbe"
"cmicu'a"
"zilcmi"
"tolcando"
"zukcfu"
"depybu'i"
"mencre"
"matmau"
"nunctu"
"selma'o"
"titnanba"
"naldra"
"jvajvo"
"nunsnu"
"nerkla"
"cimjvo"
"muvgau"
"zipcpi"
"runbau"
"faumlu"
"terbri"
"balcu'e"
"dragau"
"smuvelcki"
"piksku"
"selpli"
"bregau"
"zvafa'i"
"ci'izra"
"noltruti'u"
"samtci"
"snaxa'a"))
| 41,096 | Common Lisp | .lisp | 1,633 | 7.228414 | 60 | 0.214374 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 5ebc9a3196159b0f28c25da06ffe277e97faa4907027f123930e439d1d2b4747 | 8,083 | [
-1
] |
8,084 | transaction.lisp | glv2_cl-monero-tools/monero-tools/blockchain/transaction.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun compute-transaction-hash (transaction)
"Return the hash of a TRANSACTION. The TRANSACTION must be in
alist format."
(let* ((prefix (geta transaction :prefix))
(version (geta prefix :version)))
(ecase version
((1)
(fast-hash (serialize-transaction nil transaction)))
((2)
(let* ((rct-sig (geta transaction :rct-signature))
(rct-type (geta rct-sig :type))
(base (remove :rct-signature-prunable rct-sig :key #'car))
(prunable (geta rct-sig :rct-signature-prunable))
(prefix-hash (fast-hash (serialize-transaction-prefix nil prefix)))
(base-hash (fast-hash (serialize-rct-signature nil base)))
(prunable-hash (if prunable
(fast-hash (ecase rct-type
((#.+rct-type-full+ #.+rct-type-simple+)
(serialize-rct-range-proof nil prunable))
((#.+rct-type-bulletproof+ #.+rct-type-bulletproof-2+)
(serialize-rct-bulletproof nil prunable rct-type))))
(make-array +hash-length+
:element-type '(unsigned-byte 8)
:initial-element 0))))
(fast-hash (concatenate 'octet-vector prefix-hash base-hash prunable-hash)))))))
(defun compute-transaction-hash-from-data (transaction-data)
"Return the hash of the transaction represented by the
TRANSACTION-DATA byte vector."
(compute-transaction-hash (deserialize-transaction transaction-data 0)))
(defun compute-miner-transaction-hash (block)
"Return the hash of a BLOCK's reward transaction. The BLOCK must be in
alist format."
(compute-transaction-hash (geta block :miner-transaction)))
(defun compute-miner-transaction-hash-from-data (block-data)
"Return the hash of the reward transaction of the block represented
by the BLOCK-DATA byte vector."
(let* ((header-size (nth-value 1 (deserialize-block-header block-data 0)))
(miner-transaction-size (nth-value 1 (deserialize-transaction block-data header-size))))
(compute-transaction-hash-from-data (subseq block-data
header-size
(+ header-size miner-transaction-size)))))
(defun compute-transaction-tree-hash (hashes)
"Return the root of the Merkle tree computed from a list of
transaction HASHES."
(let ((count (length hashes))
(data (join-bytes (coerce hashes 'list))))
(tree-hash data count)))
| 2,925 | Common Lisp | .lisp | 52 | 43.230769 | 100 | 0.605658 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | cc60fefee7a4f8b10e998c463fd6f5b835512d2d18ef4208d7fb202d9db83a31 | 8,084 | [
-1
] |
8,085 | block.lisp | glv2_cl-monero-tools/monero-tools/blockchain/block.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(define-constant +mainnet-genesis-hash+
#.(hex-string->bytes "418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3")
:test #'equalp)
(define-constant +testnet-genesis-hash+
#.(hex-string->bytes "48ca7cd3c8de5b6a4d53d2861fbdaedca141553559f9be9520068053cda8430b")
:test #'equalp)
(define-constant +stagenet-genesis-hash+
#.(hex-string->bytes "76ee3cc98646292206cd3e86f74d88b4dcc1d937088645e9b0cbca84b7ce74eb")
:test #'equalp)
(defun transaction-hashes (block)
"Return the hashes of the transactions in a BLOCK (miner transaction
included)."
(concatenate 'list
(list (compute-transaction-hash (geta block :miner-transaction)))
(geta block :transaction-hashes)))
(defun compute-block-hash (block &optional slow-hash)
"Return the hash of a BLOCK. The BLOCK must be in alist format. If
SLOW-HASH is not NIL, compute the hash using slow-hash (used for the
mining process) instead of fast-hash (used for the block id)."
(let* ((block-data (serialize-block nil block))
(block-data-hash (fast-hash block-data)))
;; Exception for block 202612 because there was a bug in the tree hash function
(when (equalp block-data-hash
#.(hex-string->bytes "3a8a2b3a29b50fc86ff73dd087ea43c6f0d6b8f936c849194d5c84c737903966"))
(return-from compute-block-hash
(if slow-hash
#.(hex-string->bytes "84f64766475d51837ac9efbef1926486e58563c95a19fef4aec3254f03000000")
#.(hex-string->bytes "bbd604d2ba11ba27935e006ed39c9bfdd99b76bf4a50654bc1e1e61217962698"))))
(let* ((header (geta block :header))
(transaction-hashes (transaction-hashes block))
(root-hash (compute-transaction-tree-hash transaction-hashes))
(data (with-octet-output-stream (result)
(serialize-block-header result header)
(write-sequence root-hash result)
(serialize-integer result (length transaction-hashes)))))
(if slow-hash
(slow-hash data)
(fast-hash (concatenate 'octet-vector
(serialize-integer nil (length data))
data))))))
(defun compute-block-hash-from-data (block-data &optional slow-hash)
"Return the hash of the block represented by the BLOCK-DATA byte
vector. If SLOW-HASH is not NIL, compute the hash using slow-hash
(used for the mining process) instead of fast-hash (used for the block
id)."
(compute-block-hash (deserialize-block block-data 0) slow-hash))
(defun get-nonce-offset (block-data)
"Return the offset in BLOCK-DATA indicating the beginning of the
4 bytes long nonce of the block represented by the BLOCK-DATA byte
vector."
(nth-value 1 (deserialize block-data 0
((major-version #'deserialize-integer)
(minor-version #'deserialize-integer)
(timestamp #'deserialize-integer)
(previous-block-hash #'deserialize-hash)))))
(defun acceptable-hash-p (hash difficulty)
"Check if a block HASH (computed with slow-hash) is acceptable for
a given DIFFICULTY level."
(< (* (bytes->integer hash) difficulty) #.(expt 2 256)))
| 3,419 | Common Lisp | .lisp | 64 | 46.03125 | 107 | 0.701435 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 89e3c1f4bbd2981c7ed4047d10debe23642461ed37d3ccc9ff5a1bc4d64c7a0e | 8,085 | [
-1
] |
8,086 | miner.lisp | glv2_cl-monero-tools/monero-tools/mine/miner.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defparameter *mine-stop* nil)
(defparameter *mine-result* nil)
(defparameter *mine-lock* nil)
(defun modify-block-template (template nonce &key reserve-nonce reserve-offset in-place)
"Change the NONCE and the optional RESERVE-NONCE of a block TEMPLATE. If
IN-PLACE is NIL a new template is created, if not the TEMPLATE passed in
argument is modified."
(let ((nonce-offset (get-nonce-offset template))
(template (if in-place template (copy-seq template))))
(replace template nonce :start1 nonce-offset :end2 4)
(when (and reserve-nonce reserve-offset)
(replace template reserve-nonce
:start1 reserve-offset :end2 (length reserve-nonce)))
template))
(defun miner (template reserve-size reserve-offset difficulty)
"Given a block TEMPLATE represented by a byte vector containing a reserved
space of RESERVE-SIZE bytes starting at RESERVE-OFFSET in BLOCK-TEMPLATE-DATA
in which an extra nonce can be put, find a nonce and an extra nonce allowing
the hash of the resulting block (computed with slow-hash) to be acceptable for
a given DIFFICULTY level.
The returned value is the new block data containing the found nonces."
(let ((template (copy-seq template)))
(iter (for hash next (compute-block-hash-from-data template t))
(until (or *mine-stop* (acceptable-hash-p hash difficulty)))
(modify-block-template template (random-data 4)
:reserve-nonce (random-data reserve-size)
:reserve-offset reserve-offset
:in-place t)
(finally (return (when (acceptable-hash-p hash difficulty)
(if *mine-lock*
(progn
(with-lock-held (*mine-lock*)
(setf *mine-stop* t)
(setf *mine-result* template))
*mine-result*)
template)))))))
| 2,259 | Common Lisp | .lisp | 41 | 43.682927 | 88 | 0.633363 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 440450495509f4fc22e235ff9fd9ff5e73f56e6e27402938b833a33d092c44ad | 8,086 | [
-1
] |
8,087 | profitability.lisp | glv2_cl-monero-tools/monero-tools/mine/profitability.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2018 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-tools)
(defun mining-profitability (difficulty block-reward price hash-rate days)
"Compute the expected gain when mining with some HASH-RATE during a number of
DAYS given the network DIFFICULTY, the BLOCK-REWARD and the PRICE of a coin."
(let* ((global-hash-rate (/ difficulty +block-time+))
(ratio (/ hash-rate global-hash-rate))
(gain-per-block (* block-reward price ratio))
(blocks-per-day (/ (* 24 60 60) +block-time+))
(num-blocks (* days blocks-per-day)))
(* gain-per-block num-blocks)))
| 757 | Common Lisp | .lisp | 14 | 49.642857 | 79 | 0.699594 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 18f26bf9b28a18c027bc49b1f9bb7670db27ade7cd2c5fd62e962deb2cb30376 | 8,087 | [
-1
] |
8,088 | package.lisp | glv2_cl-monero-tools/monero-binary-rpc/package.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2018-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(defpackage :monero-binary-rpc
(:use :cl :iterate :monero-rpc :monero-utils)
(:import-from :monero-tools
#:deserialize-from-binary-storage
#:generate-secret-key
#:serialize-to-binary-storage)
(:export
#:binary-rpc
#:defbinrpc
#:get-blocks.bin
#:get-blocks-by-height.bin
#:get-hashes.bin
#:get-o-indexes.bin
#:get-outs.bin
#:get-random-outs.bin
#:get-random-rctouts.bin
#:get-transaction-pool-hashes.bin))
| 687 | Common Lisp | .lisp | 21 | 27.571429 | 60 | 0.668175 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | e0af892a773a680e11973acb80591df0bbefd70d327334d2537d38758593aff8 | 8,088 | [
-1
] |
8,089 | daemon.lisp | glv2_cl-monero-tools/monero-binary-rpc/daemon.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-binary-rpc)
(defbinrpc get-blocks.bin ("get_blocks.bin" block-ids &key start-height prune no-miner-transaction)
"Get all blocks info."
(let ((hex-block-ids (with-output-to-string (s)
(dolist (id (coerce block-ids 'list))
(write-string id s)))))
(append (list (cons "block_ids" (bytes->string (hex-string->bytes hex-block-ids))))
(when start-height
(list (cons "start_height" start-height)))
(when prune
(list (cons "prune" t)))
(when no-miner-transaction
(list (cons "no_miner_tx" t)))))
(lambda (result)
(let ((blocks (geta result :blocks)))
(dotimes (i (length blocks))
(let ((b (aref blocks i)))
(setf (geta b :block) (string->bytes (geta b :block))))))
result))
;; (get-blocks.bin (list "771fbcd656ec1464d3a02ead5e18644030007a0fc664c0a964d30922821a8148" "418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3"))
(defbinrpc get-blocks-by-height.bin ("get_blocks_by_height.bin" heights)
"Get blocks by height."
(list (cons "heights" (coerce heights '(simple-array (unsigned-byte 64) (*)))))
(lambda (result)
(let ((blocks (geta result :blocks)))
(dotimes (i (length blocks))
(let ((b (aref blocks i)))
(setf (geta b :block) (string->bytes (geta b :block))))))
result))
(defbinrpc get-hashes.bin ("get_hashes.bin" block-ids &key start-height)
"Get hashes."
(let ((hex-block-ids (with-output-to-string (s)
(dolist (id (coerce block-ids 'list))
(write-string id s)))))
(append (list (cons "block_ids" (bytes->string (hex-string->bytes hex-block-ids))))
(when start-height
(list (cons "start_height" start-height)))))
(lambda (result)
(let* ((data-string (geta result :m-block-ids))
(size (length data-string))
(key-length 32))
(unless (zerop (mod size key-length))
(error "Invalid length"))
(setf (geta result :m-block-ids)
(map 'vector
#'string->bytes
(iter (for i from 0 below size by key-length)
(collect (subseq data-string i (+ i key-length)))))))
result))
;; (get-hashes.bin (list "771fbcd656ec1464d3a02ead5e18644030007a0fc664c0a964d30922821a8148" "418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3"))
(defbinrpc get-o-indexes.bin ("get_o_indexes.bin" transaction-id)
"Get global output indexes of a transaction."
(list (cons "txid" (bytes->string (hex-string->bytes transaction-id)))))
(defbinrpc get-outs.bin ("get_outs.bin" outputs &key (get-transaction-id t))
"Get outputs."
(list (cons "outputs" (coerce outputs 'vector))
(cons "get_txid" (when get-transaction-id t)))
(lambda (result)
(let ((outs (geta result :outs)))
(dotimes (i (length outs))
(let ((out (aref outs i)))
(setf (geta out :key) (string->bytes (geta out :key)))
(setf (geta out :mask) (string->bytes (geta out :mask)))
(setf (geta out :txid) (string->bytes (geta out :txid))))))
result))
(defbinrpc get-random-outs.bin ("get_random_outs.bin" amounts output-count)
"Get a list of random outputs for a specific list of amounts."
(list (cons "amounts" (coerce amounts 'vector))
(cons "outs_count" output-count))
(lambda (result)
(let ((outs (geta result :outs)))
(dotimes (i (length outs))
(let* ((x (aref outs i))
(y (string->bytes (geta x :outs)))
(z (iter (for j from 0 below (length y) by 40)
(collect (list (cons :amount-index
(bytes->integer y
:start j
:end (+ j 8)))
(cons :output-key
(subseq y (+ j 8) (+ j 40))))))))
(setf (geta x :outs) z))))
result))
(defbinrpc get-random-rctouts.bin ("get_random_rctouts.bin" output-count)
"Get random RingCT outputs."
(list (cons "outs_count" output-count))
(lambda (result)
(let* ((outs (geta result :outs))
(x (string->bytes outs))
(y (iter (for i from 0 below (length x) by 80)
(collect (list (cons :amount
(bytes->integer x
:start i
:end (+ i 8)))
(cons :amount-index
(bytes->integer x
:start (+ i 8)
:end (+ i 16)))
(cons :output-key
(subseq x (+ i 16) (+ i 48)))
(cons :commitment
(subseq x (+ i 48) (+ i 80))))))))
(setf (geta result :outs) y))
result))
(defrawrpc get-transaction-pool-hashes.bin ("get_transaction_pool_hashes.bin")
"Get hashes from transaction pool."
nil
(lambda (result)
(let* ((result (let ((json:*use-strict-json-rules* nil))
(decode-json-from-string (bytes->string result))))
(data (geta result :tx-hashes))
(data-string (when data
(string->bytes data)))
(transaction-hashes (when data-string
(iter (for i from 0 below (length data-string) by 32)
(collect (subseq data-string i (+ i 32)))))))
(when transaction-hashes
(setf (geta result :tx-hashes) transaction-hashes))
result)))
| 6,163 | Common Lisp | .lisp | 123 | 36.162602 | 160 | 0.528787 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | c467c17f266f7e7b6c595ce05bdf72c81ece39ea71ffcbebd4891d7b1d22455c | 8,089 | [
-1
] |
8,090 | rpc.lisp | glv2_cl-monero-tools/monero-binary-rpc/rpc.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-binary-rpc)
(defun binary-rpc (method &key raw parameters (rpc-host *rpc-host*) (rpc-port *rpc-port*) (rpc-user *rpc-user*) (rpc-password *rpc-password*))
"Send a METHOD binary RPC request to the server at RPC-HOST:RPC-PORT with
optional PARAMETERS."
(let* ((page (format nil "/~(~a~)" method))
(parameters (when parameters
(serialize-to-binary-storage parameters)))
(server-uri (format nil "http://~a:~d~a" rpc-host rpc-port page))
(auth (handler-case (progn (dex:head server-uri) nil)
(dex:http-request-unauthorized (e)
(unless (and rpc-user rpc-password)
(error "USER and PASSWORD required."))
(let* ((response-headers (dex:response-headers e))
(www-authenticate (gethash "www-authenticate" response-headers))
(challenge (parse-digest-authentication-challenge www-authenticate))
(qop (geta challenge :qop))
(algorithm (geta challenge :algorithm))
(realm (geta challenge :realm))
(nonce (geta challenge :nonce)))
(compute-digest-authentication-response rpc-user
rpc-password
qop
algorithm
realm
"POST"
page
nonce)))
(t () nil))))
(multiple-value-bind (body status response-headers uri stream)
(dex:post server-uri
:headers (if auth
(list (cons "authorization" auth)
(cons "content-type" "application/octet-stream"))
(list (cons "content-type" "application/octet-stream")))
:content parameters
:force-binary raw)
(declare (ignore status response-headers uri stream))
(deserialize-from-binary-storage body 0))))
(defmacro defbinrpc (name (method &rest args) &body body)
(assert (<= (length body) 3))
(let* ((key-args-p (member '&key args))
(docstring (when (stringp (car body))
(pop body)))
(parameters (when body
(pop body)))
(postprocess (car body)))
`(defun ,name (,@args ,@(unless key-args-p (list '&key))
(rpc-host *rpc-host*) (rpc-port *rpc-port*)
(rpc-user *rpc-user*) (rpc-password *rpc-password*)
(rpc-client-secret-key (or *rpc-client-secret-key*
(generate-secret-key))))
,@(list docstring)
(let* ((client (generate-rpc-payment-signature rpc-client-secret-key))
(parameters (acons "client" client ,parameters))
(result (binary-rpc
,method
:parameters parameters
:rpc-host rpc-host
:rpc-port rpc-port
:rpc-user rpc-user
:rpc-password rpc-password)))
,(if postprocess
`(funcall ,postprocess result)
`result)))))
| 3,768 | Common Lisp | .lisp | 68 | 34.808824 | 142 | 0.479838 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | b34539b0b82aec48c45e3e773ad336e9504fec7218f2ac5a2e7bdb8fd678721f | 8,090 | [
-1
] |
8,091 | package.lisp | glv2_cl-monero-tools/monero-zmq-rpc/package.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2019 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(defpackage :monero-zmq-rpc
(:use :cl :monero-rpc :monero-utils)
(:export
#:zmq-json-rpc
#:get-block
#:get-blocks
#:get-info
#:get-transactions))
| 358 | Common Lisp | .lisp | 12 | 27 | 60 | 0.699708 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | e7b98f5f130cc60a4e1ad6c509a6793d3da6a7a3627183e2d044b31df949db30 | 8,091 | [
-1
] |
8,092 | daemon.lisp | glv2_cl-monero-tools/monero-zmq-rpc/daemon.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2019 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-zmq-rpc)
(defun get-info (&key (rpc-host *rpc-host*) (rpc-port *rpc-port*) (rpc-user *rpc-user*) (rpc-password *rpc-password*))
(zmq-json-rpc "get_info"
:rpc-host rpc-host
:rpc-port rpc-port
:rpc-user rpc-user
:rpc-password rpc-password))
(defun get-transactions (transaction-ids &key (rpc-host *rpc-host*) (rpc-port *rpc-port*) (rpc-user *rpc-user*) (rpc-password *rpc-password*))
(let ((parameters (list (cons "tx_hashes" (coerce transaction-ids 'vector)))))
(zmq-json-rpc "get_transactions"
:parameters parameters
:rpc-host rpc-host
:rpc-port rpc-port
:rpc-user rpc-user
:rpc-password rpc-password)))
(defun get-block (block-id &key (rpc-host *rpc-host*) (rpc-port *rpc-port*) (rpc-user *rpc-user*) (rpc-password *rpc-password*))
(let* ((get-by-height (integerp block-id))
(parameters (list (cons (if get-by-height "height" "hash")
block-id))))
(zmq-json-rpc (if get-by-height "get_block_header_by_height" "get_block_header_by_hash")
:parameters parameters
:rpc-host rpc-host
:rpc-port rpc-port
:rpc-user rpc-user
:rpc-password rpc-password)))
(defun get-blocks (block-ids start-height prune &key (rpc-host *rpc-host*) (rpc-port *rpc-port*) (rpc-user *rpc-user*) (rpc-password *rpc-password*))
(let* ((block-ids block-ids)
(parameters (list (cons "block_ids" block-ids)
(cons "prune" (when prune t))
(cons "start_height" start-height))))
(zmq-json-rpc "get_blocks_fast"
:parameters parameters
:rpc-host rpc-host
:rpc-port rpc-port
:rpc-user rpc-user
:rpc-password rpc-password)))
;; (zmq-get-blocks (list "5a1125384b088dbeaaa6f61c39db0318e53732ffc927978a52e3b16553203138" "48ca7cd3c8de5b6a4d53d2861fbdaedca141553559f9be9520068053cda8430b") 0 t) ; testnet
| 2,335 | Common Lisp | .lisp | 41 | 44.560976 | 174 | 0.594926 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 0d56acde4f74bf6416195f8dcd56b8996b14f303d038ecd46662710fa634c735 | 8,092 | [
-1
] |
8,093 | zmq.lisp | glv2_cl-monero-tools/monero-zmq-rpc/zmq.lisp | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2019 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :monero-zmq-rpc)
(defun zmq-json-rpc (method &key parameters (rpc-host *rpc-host*) (rpc-port *rpc-port*) (rpc-user *rpc-user*) (rpc-password *rpc-password*))
"Send a METHOD JSON RPC request to RPC-HOST:RPC-PORT with optional
PARAMETERS."
(declare (ignore rpc-user rpc-password))
(let* ((server-uri (format nil "tcp://~a:~a" rpc-host rpc-port))
(request (list (cons :jsonrpc "2.0")
(cons :id (random 1000000))
(cons :method (string-downcase (string method)))
(cons :params parameters)))
(json-request (encode-json-to-string request)))
(pzmq:with-socket socket :req
(pzmq:connect socket server-uri)
(pzmq:send socket json-request)
(let* ((json-answer (pzmq:recv-string socket))
(answer (decode-json-from-string json-answer))
(err (geta answer :error)))
(if err
(error (geta err :message))
(geta answer :result))))))
| 1,201 | Common Lisp | .lisp | 24 | 41.541667 | 140 | 0.623188 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 1d3d02123f2cf5fd0bfab97dfd9b04a26cc381f613c32ec8c7d18c870a57284e | 8,093 | [
-1
] |
8,094 | monero-utils.asd | glv2_cl-monero-tools/monero-utils.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2019 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-utils"
:name "monero-utils"
:description "Utility functions for monero-tools"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("alexandria"
"babel"
"cffi"
"cl-json"
"ironclad")
:components ((:module "monero-utils"
:serial t
:components ((:file "package")
(:file "utils")
(:file "base58")))))
| 723 | Common Lisp | .asd | 21 | 25.47619 | 60 | 0.563662 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 166caf1010e9e77a412a33782338f15b97254875af334e0ed161755ad5dddbe3 | 8,094 | [
-1
] |
8,095 | monero-binary-rpc.asd | glv2_cl-monero-tools/monero-binary-rpc.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2019 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-binary-rpc"
:name "monero-binary-rpc"
:description "RPC tools to work with the Monero crypto-currency"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("dexador"
"iterate"
"monero-rpc"
"monero-tools"
"monero-utils")
:components ((:module "monero-binary-rpc"
:serial t
:components ((:file "package")
(:file "rpc")
(:file "daemon")))))
| 765 | Common Lisp | .asd | 21 | 27.47619 | 66 | 0.576248 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 84e66b55b4693fedba068b781d4a363ccaa9e07bf141fd63db0af9c1e1c3ab02 | 8,095 | [
-1
] |
8,096 | monero-tools.asd | glv2_cl-monero-tools/monero-tools.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2016-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-tools"
:name "monero-tools"
:description "Tools to work with the Monero crypto-currency"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("alexandria"
"babel"
"bordeaux-threads"
"cffi"
"cl-json"
"cl-octet-streams"
"cl-ppcre"
"cl-qrencode"
"dexador"
"ieee-floats"
"ironclad"
"iterate"
"monero-utils"
"png-read"
"split-sequence")
:in-order-to ((test-op (test-op "monero-tools-tests")))
:components ((:module "monero-tools"
:serial t
:components ((:file "package")
(:module "crypto"
:serial t
:components ((:file "asm-sbcl-x86-64")
(:file "blake")
(:file "keccak")
(:file "pseudo-aes")
(:file "random-math")
(:file "cryptonight")
(:file "randomx-service")
(:file "randomx")
(:file "crypto")
(:file "key")
(:file "multisig")
(:file "proof")
(:file "signature")))
(:module "mnemonic"
:serial t
:components ((:file "mnemonic")
(:file "chinese-simplified")
(:file "dutch")
(:file "english")
(:file "esperanto")
(:file "french")
(:file "german")
(:file "italian")
(:file "japanese")
(:file "lojban")
(:file "portuguese")
(:file "russian")
(:file "spanish")))
(:module "openalias"
:serial t
:components ((:file "dns")
(:file "openalias")))
(:module "serialization"
:serial t
:components ((:file "constants")
(:file "deserialization")
(:file "serialization")
(:file "storage")))
(:module "blockchain"
:serial t
:components ((:file "transaction")
(:file "block")))
(:module "mine"
:components ((:file "miner")
(:file "profitability")))
(:module "wallet"
:serial t
:components ((:file "address")
(:file "multisig")
(:file "uri")
(:file "qr")
(:file "signature")
(:file "transaction")
(:file "wallet-file")))))))
| 4,271 | Common Lisp | .asd | 86 | 20.732558 | 71 | 0.300096 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 8141a4f5d812e12876e03c9ab374e73ef526d212b76a886def78b26544f405f8 | 8,096 | [
-1
] |
8,097 | monero-custom-rpc.asd | glv2_cl-monero-tools/monero-custom-rpc.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2019-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-custom-rpc"
:name "monero-custom-rpc"
:description "RPC tools to work with the Monero crypto-currency"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("bordeaux-threads"
"iterate"
"monero-binary-rpc"
"monero-rpc"
"monero-tools"
"monero-utils")
:components ((:module "monero-custom-rpc"
:serial t
:components ((:file "package")
(:file "history")
(:file "miner")))))
| 817 | Common Lisp | .asd | 22 | 27.863636 | 66 | 0.57702 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 58e73051fb5fc7e25c3462f49b492d176e2fe8e4aebc2e17f9b61badd48d6501 | 8,097 | [
-1
] |
8,098 | monero-tools-tests.asd | glv2_cl-monero-tools/monero-tools-tests.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2019-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-tools-tests"
:name "monero-tools-tests"
:description "Tests for monero-tools"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("fiveam"
"iterate"
"monero-tools"
"monero-utils"
"uiop")
:in-order-to ((test-op (load-op "monero-tools-tests")))
:perform (test-op (op s)
(let ((tests (uiop:find-symbol* 'monero-tools-tests
:monero-tools-tests)))
(uiop:symbol-call :fiveam 'run! tests)))
:components ((:module "tests"
:serial t
:components ((:file "tests")
(:file "blockchain")
(:file "crypto")
(:file "mine")
(:file "mnemonic")
(:file "openalias")
(:file "serialization")
(:file "utils")
(:file "wallet")))))
| 1,311 | Common Lisp | .asd | 32 | 26.25 | 74 | 0.473354 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | cc8da015c1781806a237714523c2af7ab8a94c351f94d57bf872cd242af83278 | 8,098 | [
-1
] |
8,099 | monero-zmq-rpc.asd | glv2_cl-monero-tools/monero-zmq-rpc.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2019 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-zmq-rpc"
:name "monero-zmq-rpc"
:description "RPC tools to work with the Monero crypto-currency"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("monero-rpc"
"monero-utils"
"pzmq")
:components ((:module "monero-zmq-rpc"
:serial t
:components ((:file "package")
(:file "zmq")
(:file "daemon")))))
| 698 | Common Lisp | .asd | 19 | 28.526316 | 66 | 0.587278 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 9460466287ab6de74d7caa168b3eee8b492c0b227ec2d38e03a69ce0bf36285b | 8,099 | [
-1
] |
8,100 | monero-p2p.asd | glv2_cl-monero-tools/monero-p2p.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2018-2020 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-p2p"
:name "monero-p2p"
:description "P2P tools to work with the Monero crypto-currency"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("alexandria"
"dexador"
"ironclad"
"iterate"
"monero-tools"
"monero-utils")
:components ((:module "monero-p2p"
:serial t
:components ((:file "package")
(:file "constants")
(:file "levin")
(:file "p2p")))))
| 823 | Common Lisp | .asd | 23 | 25.608696 | 66 | 0.544542 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 9042a1031631b72993c663722c13dbf8b5290d550f2a6a20ee7894f8ea15d9b6 | 8,100 | [
-1
] |
8,101 | monero-rpc.asd | glv2_cl-monero-tools/monero-rpc.asd | ;;;; This file is part of monero-tools
;;;; Copyright 2019 Guillaume LE VAILLANT
;;;; Distributed under the GNU GPL v3 or later.
;;;; See the file LICENSE for terms of use and distribution.
(cl:in-package :asdf-user)
(defsystem "monero-rpc"
:name "monero-rpc"
:description "RPC tools to work with the Monero crypto-currency"
:version "0.1"
:author "Guillaume LE VAILLANT"
:license "GPL-3"
:depends-on ("cl-base64"
"cl-json"
"dexador"
"ironclad"
"monero-tools"
"monero-utils"
"split-sequence")
:components ((:module "monero-rpc"
:serial t
:components ((:file "package")
(:file "rpc")
(:file "daemon")
(:file "wallet")))))
| 847 | Common Lisp | .asd | 24 | 24.875 | 66 | 0.534146 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 72a63906945464388231928e5ff86887fa0d7b557fae57abacae0132b50cc767 | 8,101 | [
-1
] |
8,105 | .dir-locals.el | glv2_cl-monero-tools/.dir-locals.el | ((lisp-mode
.
((eval . (put 'serialize 'common-lisp-indent-function 2))
(eval . (put 'serialize-variant 'common-lisp-indent-function 2))
(eval . (put 'deserialize 'common-lisp-indent-function 2))
(eval . (put 'deserialize-variant 'common-lisp-indent-function 2)))))
| 279 | Common Lisp | .l | 6 | 43.333333 | 72 | 0.695971 | glv2/cl-monero-tools | 19 | 4 | 0 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 887ad242760ac23103ffeffaa555660762f15cd313f8d388f856283e481a1af7 | 8,105 | [
-1
] |
8,196 | hello.lisp | evrim_core-server/examples/hello.lisp | ;; -------------------------------------------------------------------------
;; [Core-serveR] Hello World Web Example
;; -------------------------------------------------------------------------
;; Load the file with C-c C-l and visit,
;; http://localhost:8080/hello/
;; -------------------------------------------------------------------------
;; Define a new namespace
;; -------------------------------------------------------------------------
(defpackage :hello
(:use :cl :core-server :arnesi))
;; -------------------------------------------------------------------------
;; Switch to new namespace
;; -------------------------------------------------------------------------
(in-package :hello)
;; -------------------------------------------------------------------------
;; Hello Application Definition
;; -------------------------------------------------------------------------
(defapplication hello-application (http-application)
()
(:default-initargs :fqdn "hello" :admin-email "[email protected]"))
;; -------------------------------------------------------------------------
;; Define 'page' function which gets body as a parameter
;; -------------------------------------------------------------------------
(defun/cc page (body)
(<:html
(<:head (<:title "Core Server - Hello Example"))
(<:body body)))
;; -------------------------------------------------------------------------
;; Create a handler via defhandler
;; -------------------------------------------------------------------------
(defhandler "index" ((self hello-application))
(page (<:h1 "Hello, World!")))
;; -------------------------------------------------------------------------
;; Create an application instance
;; -------------------------------------------------------------------------
(defparameter *hello* (make-instance 'hello-application))
;; -------------------------------------------------------------------------
;; Register application to [core-serveR]
;; -------------------------------------------------------------------------
;; (register *server* *hello*)
;; -------------------------------------------------------------------------
;; This example is less then 15 LoC.
;; -------------------------------------------------------------------------
| 2,272 | Common Lisp | .lisp | 43 | 51.255814 | 76 | 0.276452 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 42a4d6872e08f44cb754a29b0a5a01747802382dd3f136ce2b604fd80826fe9b | 8,196 | [
-1
] |
8,197 | poleposition.lisp | evrim_core-server/examples/poleposition.lisp | ;; A simple example to demonstrate the performance of prevalence
;; database
(defpackage :poleposition
(:use :cl :core-server :arnesi))
(in-package :poleposition)
(defclass+ pilot (object-with-id)
((name)
(firstname)
(points :index t)
(licenseid)))
(defcrud pilot)
(defparameter *db*
(make-instance 'database-server
:database-directory #P"/tmp/poleposition/"
:auto-start t))
;;;; Executing body in one transaction
(defun pp-write (count)
(with-transaction (*db*)
(loop
for i from 1 to count
do (pilot.add *db* :name (format nil "Pilot_~D" i) :firstname "Herkules" :points i :licenseid i))))
(defun pp-read (count)
(loop
for i from 1 to count
do (pilot.find *db* :points i)))
(defun pp-delete (count)
(with-transaction (*db*)
(mapcar (arnesi::curry #'pilot.delete *db*) (take count (pilot.list *db*)))))
(defun test (&optional (count 3000))
(start *db*)
(format t "* Creating ~A objects~%" count)
(time (pp-write count))
(format t "* Reading ~A objects~%" count)
(time (pp-read count))
(format t "* Deleting ~A objects~%" count)
(time (pp-delete count))
nil)
| 1,142 | Common Lisp | .lisp | 37 | 27.594595 | 106 | 0.671533 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 1ea3be3790bb10f47d713fe430eeece5b5ce3c056b923e1c562705d603115c89 | 8,197 | [
-1
] |
8,198 | crud.lisp | evrim_core-server/examples/crud.lisp | (defpackage :crud
(:use :cl :core-server :arnesi))
(in-package :crud)
(defclass+ crud-application (http-application database)
()
(:metaclass http-application+)
(:default-initargs :auto-start t))
(defclass+ user ()
((username :host both)
(email :host both)
(password :host local)))
(defcrud user)
(defcomponent user-proxy ()
((username :host both)
(email :host both)
(password :host remote)))
(defcomponent crud-application-component ()
((crud :initform (<core:crud :template-class (find-class 'data-proxy-template)))
(table :initform (<core:table :template-class (find-class 'data-proxy-template)
:primary-field "slot1"))
(local-cache :initform (make-hash-table :test #'string=)
:host none)))
(defmethod/local get-instances ((self crud-application-component))
(mapcar (lambda (user)
(let ((random-id (random-string 5)))
(setf (gethash random-id (local-cache self)) random-id)
(let ((obj (object->jobject user)))
(set-attribute obj "ref-id" random-id)
obj)))
(user.list (component.application self))))
(defmethod/local save-it ((self crud-application-component) instance-id slots)
(let ((instance (gethash instance-id (local-cache self))))
(break (list 'save-it instance slots))))
(defmethod/local add-it ((self crud-application-component) slots)
(break (list 'add-it slots)))
(defmethod/remote add-link ((self crud-application-component) e)
(let ((slots (call-component (call/cc (crud self) (.get-element-by-id docuent "crud")))))
(let ((instance (add-it self slots)))
(init self))))
;; data JSComponent :: Object -> IO Object
;; call/cc :: JSComponent ->
;; -------------------------------------------------------------------------
;; Javascript call/cc: (f &rest args) -> (apply #'f (append args (list k)))
;; -------------------------------------------------------------------------
;; CRUD> (js
;; (progn
;; (defun usual-function () 1)
;; (defun/cc callcc-function () 2)
;; (defun manual-continuation () (k 3))
;; (with-call/cc (usual-function))
;; (with-call/cc (callcc-function))
;; (with-call/cc (call/cc manual-continuation alert))))
;; "function usualFunction() {
;; return 1;
;; };
;; function callccFunction(k11991) {
;; k11991 = k11991 || window.k;
;; return k11991(2);
;; };
;; function manualContinuation() {
;; return k(3);
;; };
;; k(usualFunction());
;; callccFunction(k);
;; manualContinuation(alert, k);"
(defmethod/remote init ((self crud-application-component))
(setf window.core self)
(let ((instances (get-instances self)))
(debug instances)
(make-web-thread
(lambda ()
(let ((table (call/cc (table self)
(extend (jobject :instances instances)
(.get-element-by-id document "table")))))
(let ((selected (call-component table)))
(debug selected)
(let ((crud (call/cc (crud self)
(extend (jobject :instance selected)
(.get-element-by-id docuent "crud")))))
(let ((slots (call-component crud)))
(save-it self selected slots)))))))))
(defhandler "index2.html" ((self crud-application))
(<:html (<:head (<:script :type "text/javascript" :src "library.core") (crud-application-component))
(<:body (<:h1 "Data Crud:")
(<:table :id "table")
(<:a :id "add" :onclick "javascript:core.addLink()" "Add")
(<:div :id "crud"))))
;; (defhandler "index.html" ((self crud-application))
;; (let* ((crud (<core:crud :template-class (find-class 'data-proxy-template)))
;; (table (<core:table
;; :instances (data.list self)
;; :template-class (find-class 'data-proxy-template)
;; :primary-field "slot1"
;; :id "table")))
;; (destructuring-bind (slot . value)
;; (send/suspend
;; (<:html (<:head (<:script :type "text/javascript" :src "library.core"))
;; (<:body (<:h1 "Data Crud:") table (<:div :id "crud") (<:a :id "add" "Add")
;; (<:script :type "text/javascript"
;; (lambda (stream)
;; (with-js (crud) stream
;; (let ((crud crud))
;; (with-call/cc
;; (let ((table (.get-element-by-id document "table")))
;; (let ((instance (call-component table)))
;; (let ((crud (call/cc crud
;; (extend (jobject :instance instance)
;; (.get-element-by-id document "crud")))))
;; (call-component crud)
;; (init table)))))
;; (connect (.get-element-by-id document "add") "onclick"
;; (lambda (e)
;; (with-call/cc
;; (let ((instance (jobject :instance
;; (jobject :class
;; (jobject :slot1
;; (jobject :label "Slot1"
;; :name "slot1"
;; :type "primitive"))
;; :slot1 nil))))
;; (let ((crud (call/cc crud
;; (extend instance
;; (.get-element-by-id document "crud")))))
;; (debug instance)
;; (debug crud)
;; (call-component crud))))
;; false)))))))))
;; (let ((instance (slot-value table 'core-server::selected)))
;; (case slot
;; (slot1 (data.update self instance :slot1 value))
;; (slot2 (data.update self instance :slot2 (update-session 'slot2 value)))))
;; (setf (slot-value table 'instances) (data.list self))
;; (continue-component crud t))))
(deftransaction init-database ((self crud-application))
(user.add self :username "evrim" :email "[email protected]")
(user.add self :username "aycan" :email "[email protected]")
self)
(defparameter *crud
(make-instance 'crud-application
:fqdn "crud"
:admin-email "[email protected]"))
(register *server* *crud)
| 5,623 | Common Lisp | .lisp | 142 | 37.119718 | 102 | 0.601098 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 2b7b22e5763f46b45e7a76c69bd67894a792df66fbe6fb971f69e0d630b43527 | 8,198 | [
-1
] |
8,199 | links.lisp | evrim_core-server/examples/links.lisp | ;; Links web application demonstrating javascript usage
;; http://localhost:8080/links/main
;; TODO: will be rewritten with upcoming javascript components
(defpackage :links
(:use :cl :core-server :arnesi))
(in-package :links)
;; Create an application
(defparameter *links-app*
(make-instance 'http-application
:fqdn "links"
:admin-email "[email protected]"))
(defparameter *links-db* (make-hash-table :test #'equal))
(defun put-link (url-n-title)
(setf (gethash (car url-n-title) *links-db*) (cons (cadr url-n-title) 1)))
(defun get-link (url)
(gethash url *links-db*))
(defun rate-link (url rate)
(let ((val (gethash url *links-db*)))
(setf (gethash url *links-db*) (cons (car val) (+ rate (cdr val))))))
(defun/cc all-links (db)
(mapcar #'display-link (hash-table-keys db) (hash-table-values db)))
;; Render a page
(defun/cc page (body)
(<:html
(<:head
(<:meta :http--equiv "Content-Type" :content "text/html; charset=utf-8"))
(<:body
(<:h1 "Links Example")
body)))
;; Display the result
(defun/cc display-link (url title-n-count)
(<:div :class "link"
(<:p (format nil "~D" (cdr title-n-count))
(<:a :href url (car title-n-count))
(<:a :href (action/url () (answer (list :rate url 1))) "+1")
(<:a :href (action/url () (answer (list :rate url -1))) "-1"))))
;; Read a link
(defun/cc read-link ()
(page
(<:form :method "POST"
:action (action/url ((title "title") (link "link"))
(answer (list :addlink link title)))
(<:p "Please enter title and URL:")
(<:input :type "text" :name "title")
(<:input :type "text" :name "link")
(<:input :type "submit" :value "Post"))))
;; Register a handler
(defhandler "main" ((self http-application))
(labels ((ctl (ans)
(case (car ans)
(:new
(ctl (send/forward (read-link))))
(:addlink
(put-link (cdr ans)))
(:rate
(rate-link (cadr ans) (caddr ans)))
(otherwise
(let ((res (send/suspend
(page
(list (<:p "Add Link: " (<:a :href (action/url () (answer (list :new))) "+"))
(<:div :id "links" (all-links *links-db*)))))))
(ctl res))))
(ctl nil)))
(ctl nil)))
(register *server* *links-app*) | 2,220 | Common Lisp | .lisp | 65 | 30.107692 | 86 | 0.612226 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 766837781f2c8f1c12789aebed7790c301581817f7aab5644ac89edb5473880b | 8,199 | [
-1
] |
8,200 | defclass+.lisp | evrim_core-server/examples/defclass+.lisp | (in-package :core-server)
;; +-------------------------------------------------------------------------
;; | Defining Classes with defclass+
;; +-------------------------------------------------------------------------
(defclass+ a ()
((slot-in-the-server :host local :initform "I can win")
(slot-in-the-client :host remote :initform (jobject :foo "bar"
:moo "tar")))
(:ctor make-a))
;; {
;; "coreClass": {
;; "slotInTheClient": {
;; "name": 'slotInTheClient',
;; "type": 'primitive',
;; "label": 'Slot In The Client' }
;; }
;; ,
;; "slotInTheClient": {
;; "foo": 'bar',
;; "moo": 'tar' }
;; }
(let ((a (make-a :slot-in-the-server "win can I")))
(with-js (a) (make-indented-stream *core-output*)
a))
;; +-------------------------------------------------------------------------
;; | Defining Components with defcomponent
;; +-------------------------------------------------------------------------
(defcomponent b (a)
()
(:ctor make-b))
(defmethod/local get-time ((self b))
(get-universal-time))
(defmethod/remote init ((self b))
(alert (+ "Hello, i'm B, time is :"
(date-to-string
(list-date-to-javascript (get-time self))))))
(let ((b (make-b :slot-in-the-server "win can I")))
(with-js (b) (make-indented-stream *core-output*)
b))
;;function (toExtend, k11) {
;; var k11 = k11 || window.k;
;; var g2 = toExtend || new Object();
;; extend({
;; clientDestroy: makeMethod(function (k1108) {
;; var self = self || this;
;; self._destroy = function (k1114) {
;; return k1114(this);
;; };
;; return self.destroy(k1108);
;; }),
;; _destroy: makeMethod(function (k1100) {
;; var self = self || this;
;; addToGc(function (k1104) {
;; return k1104(new Array('TEST-COMPONENT-DESTROY.core' + '?s:' + 'unbound-session-id', 'b-YiGBSxYe'));
;; });
;; return k1100(true);
;; }),
;; funkall: makeMethod(function (action, args, k191) {
;; var k191 = k191 || window.k;
;; var self = self || this;
;; return funcallCc(self.url + action + '$', args, function (g93) {
;; if ('function' == (typeof g93)) {
;; return g93(self, k191);
;; } else {
;; return k191(g93);
;; };
;; });
;; }),
;; getTime: function (k187) {
;; var self = self || this;
;; return self.funkall('?s:' + 'unbound-session-id' + '$k:' + 'b-YiGBSxYe' + '$method:' + 'GET-TIME', {}, k187);
;; }
;; }, g2);
;; mapobject(function (k, v, k158) {
;; var k158 = k158 || window.k;
;; if ((!(('undefined' == (typeof v)) || (null === v)) && (('' === g2[k]) || (('undefined' == (typeof g2[k])) || (null === g2[k])) || ('undefined' === g2[k]))) || ('undefined' === (typeof g2[k]))) {
;; return k158(g2[k] = v);
;; } else {
;; return k158(null);
;; };
;; }, {
;; slotInTheClient: {
;; "foo": 'bar',
;; "moo": 'tar' }
;; ,
;; url: null
;; });
;; g2.ctor = arguments.callee;
;; return apply(makeMethod(function (k147) {
;; var self = self || this;
;; return self.getTime(function (g52) {
;; return k147(alert('Hello, i\'m B, time is :' + dateToString(listDateToJavascript(g52))));
;; });
;; }), g2, null, function (value9) {
;; g2.destroy = composeProg1Cc(makeMethod(function (k128) {
;; var self = self || this;
;; var g34 = self._destroy;
;; if (!(('undefined' == (typeof g34)) || (null === g34))) {
;; return self._destroy(function (value37) {
;; removeSlots(self, new Array('_destroy'));
;; removeSlots(self, new Array('destroy'));
;; return k128(self);
;; });
;; } else {
;; removeSlots(self, new Array('destroy'));
;; return k128(self);
;; };
;; }), g2.destroy);
;; g2._destroy = makeMethod(function (k115) {
;; var self = self || this;
;; addToGc(function (k119) {
;; return k119(new Array('TEST-COMPONENT-DESTROY.core' + '?s:' + 'unbound-session-id', 'b-YiGBSxYe'));
;; });
;; return k115(true);
;; });
;; return k11(g2);
;; });
;; }
(let ((b (make-b :slot-in-the-server "win can I")))
(with-js (b) (make-indented-stream *core-output*)
b))
;; +-------------------------------------------------------------------------
;; | Inheritance
;; +-------------------------------------------------------------------------
(defcomponent c (b)
()
(:ctor make-c))
(defmethod/remote init ((self c))
(call-next-method self)
(alert (+ "I am C.")))
;; function (toExtend, k11) {
;; var k11 = k11 || window.k;
;; var g2 = toExtend || new Object();
;; extend({
;; clientDestroy: makeMethod(function (k1113) {
;; var self = self || this;
;; self._destroy = function (k1119) {
;; return k1119(this);
;; };
;; return self.destroy(k1113);
;; }),
;; _destroy: makeMethod(function (k1105) {
;; var self = self || this;
;; addToGc(function (k1109) {
;; return k1109(new Array('TEST-COMPONENT-DESTROY.core' + '?s:' + 'unbound-session-id', 'c-NHVQvjPb'));
;; });
;; return k1105(true);
;; }),
;; funkall: makeMethod(function (action, args, k196) {
;; var k196 = k196 || window.k;
;; var self = self || this;
;; return funcallCc(self.url + action + '$', args, function (g98) {
;; if ('function' == (typeof g98)) {
;; return g98(self, k196);
;; } else {
;; return k196(g98);
;; };
;; });
;; }),
;; getTime: function (k192) {
;; var self = self || this;
;; return self.funkall('?s:' + 'unbound-session-id' + '$k:' + 'c-NHVQvjPb' + '$method:' + 'GET-TIME', {}, k192);
;; }
;; }, g2);
;; mapobject(function (k, v, k163) {
;; var k163 = k163 || window.k;
;; if ((!(('undefined' == (typeof v)) || (null === v)) && (('' === g2[k]) || (('undefined' == (typeof g2[k])) || (null === g2[k])) || ('undefined' === g2[k]))) || ('undefined' === (typeof g2[k]))) {
;; return k163(g2[k] = v);
;; } else {
;; return k163(null);
;; };
;; }, {
;; slotInTheClient: {
;; "foo": 'bar',
;; "moo": 'tar' }
;; ,
;; url: null
;; });
;; g2.ctor = arguments.callee;
;; return apply(makeMethod(function (k147) {
;; var self = self || this;
;; return self.getTime(function (g57) {
;; alert('Hello, i\'m B, time is :' + dateToString(listDateToJavascript(g57)));
;; return k147(alert('I am C.'));
;; });
;; }), g2, null, function (value9) {
;; g2.destroy = composeProg1Cc(makeMethod(function (k128) {
;; var self = self || this;
;; var g34 = self._destroy;
;; if (!(('undefined' == (typeof g34)) || (null === g34))) {
;; return self._destroy(function (value37) {
;; removeSlots(self, new Array('_destroy'));
;; removeSlots(self, new Array('destroy'));
;; return k128(self);
;; });
;; } else {
;; removeSlots(self, new Array('destroy'));
;; return k128(self);
;; };
;; }), g2.destroy);
;; g2._destroy = makeMethod(function (k115) {
;; var self = self || this;
;; addToGc(function (k119) {
;; return k119(new Array('TEST-COMPONENT-DESTROY.core' + '?s:' + 'unbound-session-id', 'c-NHVQvjPb'));
;; });
;; return k115(true);
;; });
;; return k11(g2);
;; });
;; }
(let ((c (make-c :slot-in-the-server "win can I")))
(with-js (c) (make-indented-stream *core-output*)
c))
(let ((b (make-b :slot-in-the-server "win can I")))
(with-js (b) (make-indented-stream *core-output*)
(with-call/cc
(call/cc b
(extend (jobject :slot-in-the-client "remote!")
(<:input :type "text" :name "field1")))))) | 7,862 | Common Lisp | .lisp | 219 | 34.333333 | 202 | 0.486306 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 7d4a9e97da681ba0133b141c394dec660e916f10874f890054176cf3ba58772b | 8,200 | [
-1
] |
8,201 | pinger.lisp | evrim_core-server/examples/pinger.lisp | ;; Pinger example
;; Demonstrating core-server defcommand and parser
(defpackage :pinger
(:use #:cl #:core-server #:arnesi))
(in-package :pinger)
;; -------------------------------------------------------------------------
;; Ping - Command Example
;; -------------------------------------------------------------------------
;;
;; PINGER> (ping :ping-host "www.google.com" :ping-count 3)
;; Executing command: /bin/ping -q -c 3 www.google.com
;; PING www.l.google.com (74.125.43.147) 56(84) bytes of data.
;; --- www.l.google.com ping statistics ---
;; 3 packets transmitted, 3 received, 0% packet loss, time 2007ms
;; rtt min/avg/max/mdev = 85.446/146.500/191.014/44.659 ms
;; NIL
;; path to ping executable
(defparameter +ping+ (core-server::whereis "ping"))
;; Sample output that we need to parse.
;;
;; quad% ping -q node6 -c 3
;; PING node6.core.gen.tr (213.232.33.242) 56(84) bytes of data.
;;
;; --- node6.core.gen.tr ping statistics ---
;; 3 packets transmitted, 3 received, 0% packet loss, time 2007ms
;; rtt min/avg/max/mdev = 10.106/10.439/10.620/0.235 ms
;; min,max,avg,mdev are temporary named variables of this parser
;;
;; we're trying to parse the sequence "rtt min/avg/max/mdev = ", if it
;; fails we parse an octet and loop until the end of the stream. If we
;; can parse the sequence, we'll parse floats and then return them as
;; a list of floats.
(defrule ping? (min max avg mdev)
(:zom (:or (:and (:seq "rtt min/avg/max/mdev = ")
(:float? min)
#\/
(:float? avg)
#\/
(:float? max)
#\/
(:float? mdev)
(:seq " ms")
(:return (list (parse-float min)
(parse-float max)
(parse-float avg)
(parse-float mdev))))
(:type octet?))))
;; We're defining a command with two arguments.
;; We'll have a function like this:
;;
;; (ping &key (ping-host (error "Specify host")) (ping-count "1")
(defcommand ping (shell)
((ping-host :host local :initform (error "Specify host"))
(ping-count :host local :initform "1"))
(:default-initargs :cmd +ping+ :verbose t))
(defmethod render-arguments ((self ping))
(list "-q" "-c" (slot-value self 'ping-count) (slot-value self 'ping-host)))
;; In the run method, we're setting the command arguments according to
;; the commands protocol. And then parse output with ping?.
(defmethod run ((self ping))
(call-next-method)
(with-core-stream (s (command.output-stream self))
(ping? s)))
| 2,430 | Common Lisp | .lisp | 63 | 35.904762 | 78 | 0.628292 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 90624a317e4f6f1e0e33344d3d8e29367c8ec689158065cec8a3fa3ab686cc83 | 8,201 | [
-1
] |
8,202 | quiz.lisp | evrim_core-server/examples/quiz.lisp | ;; -------------------------------------------------------------------------
;; [Core-serveR] Quiz Example
;; -------------------------------------------------------------------------
;; Load the file with C-c C-l and visit,
;; http://localhost:8080/quiz/
;; -------------------------------------------------------------------------
;; Define a new namespace
;; -------------------------------------------------------------------------
(defpackage :quiz
(:use :cl :core-server :arnesi))
;; -------------------------------------------------------------------------
;; Switch to new namespace
;; -------------------------------------------------------------------------
(in-package :quiz)
;; -------------------------------------------------------------------------
;; Quiz Application Definition
;; -------------------------------------------------------------------------
(defapplication quiz-application (http-application)
()
(:default-initargs :fqdn "quiz" :admin-email "[email protected]"))
;; -------------------------------------------------------------------------
;; Question Data as Lists
;; -------------------------------------------------------------------------
(defparameter *questions*
'(("First Question?" ("1" "2" "3" "4" "5") 2)
("Second Question?" ("1" "2" "3" "4" "5") 3)
("Third Question?" ("1" "2" "3" "4" "5") 4)))
;; -------------------------------------------------------------------------
;; Question Data Accessors
;; -------------------------------------------------------------------------
(defun text (question)
(car question))
(defun options (question)
(cadr question))
(defun answer-index (question)
(last1 question))
(defun right-option (question)
(nth (- (answer-index question) 1) (options question)))
(defun right? (question answer)
(equal (right-option question) answer))
;; -------------------------------------------------------------------------
;; Define 'page' function which gets body as a parameter
;; -------------------------------------------------------------------------
(defun/cc page (body)
(<:html (<:head
(<:meta :http--equiv "Content-Type" :content "text/html; charset=utf-8")
(<:title "Core Server - Quiz Example"))
(<:body
(<:h1 "[Core-serveR] - Quiz Example")
body)))
;; -------------------------------------------------------------------------
;; Display the result
;; -------------------------------------------------------------------------
(defun/cc send-result (wrongs)
(send/forward
(page
(<:div
(if wrongs
(<:div
(<:p "You answered wrong to some of the questions.")
(mapcar #'(lambda (w)
(<:div
(<:p "Question: " (text (car w)))
(<:p "The Answer should be: " (right-option (car w)))
(<:p "You answered: " (cadr w))))
wrongs))
(<:p "Congrats!"))
(<:a :href "index" "Restart")))))
;; -------------------------------------------------------------------------
;; Ask a single question
;; -------------------------------------------------------------------------
(defun/cc ask-question (question)
(send/suspend
(page
(<:form :method "POST"
:action (action/url ((ans "ans"))
(answer ans))
(<:p (text question))
(mapcar #'(lambda (o)
(<:span (<:input :type "radio" :name "ans" :value o) o))
(options question))
(<:br)
(<:p (<:input :type "submit" :value "Next"))))))
;; -------------------------------------------------------------------------
;; Ask Questions
;; -------------------------------------------------------------------------
(defun/cc ask-questions (questions)
(let ((answers))
(dolist (q questions)
(let ((ans (ask-question q)))
(unless (right? q ans)
(push (list q ans) answers))))
answers))
;; -------------------------------------------------------------------------
;; Begin Quiz
;; -------------------------------------------------------------------------
(defun/cc begin-quiz ()
(send/suspend
(page
(<:div
(<:p "Welcome to the Quiz Example.")
(<:p "Click to start your quiz.")
(<:form :method "POST"
:action (action/url ()
(answer nil))
(<:input :type "submit" :value "Begin"))))))
;; -------------------------------------------------------------------------
;; Register a handler
;; -------------------------------------------------------------------------
(defhandler "index" ((self quiz-application))
(begin-quiz)
(let ((wrongs (reverse (ask-questions *questions*))))
(send-result wrongs)))
;; -------------------------------------------------------------------------
;; Create an application instance
;; -------------------------------------------------------------------------
(defparameter *quiz* (make-instance 'quiz-application))
;; -------------------------------------------------------------------------
;; Register our application to the server
;; -------------------------------------------------------------------------
;; (register *server* *quiz*)
;; EoF | 5,006 | Common Lisp | .lisp | 122 | 37.909836 | 76 | 0.351757 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 2f00b1f0d66c8e3292f20e40b984b60494b4016ea5262dab7d920af8f2558962 | 8,202 | [
-1
] |
8,203 | blog.lisp | evrim_core-server/examples/blog.lisp | (in-package :core-server)
;; +----------------------------------------------------------------------------
;; | Core Server Example - Blog
;; +----------------------------------------------------------------------------
(defpackage :blog
(:use :cl :core-server :arnesi))
(in-package :blog)
;;
;; A persistent multi-user blog example.
;;
;; http://localhost:8080/blog/index.core
;;
;; To run this example type in the repl:
;;
;; (in-package :blog)
;; (register *server* *app*)
;; (start *app*)
;; (init-database *app*)
;;
;; we define classes and their relations here
(defclass+ author (object-with-id)
((email :initform (error "Please specify :email"))
(password :initform (error "Please specify :password"))
(name :initform nil)
(creation-date :initform (get-universal-time))
(blogs :type blog* :relation author)
(comments :type comment* :relation author)))
(defclass+ comment (object-with-id)
((author :type author :relation comments :initform (error "please specify :author"))
(text :initform (error "please specify :text"))
(timestamp :initform (get-universal-time))
(blog :type blog :relation comments))
(:ctor (author text)))
(defclass+ blog (object-with-id)
((author :type author :relation blogs)
(title :type string :initform (error "Please specify :title"))
(text :type string :initform (error "please specify :text"))
(timestamp :initform (get-universal-time))
(comments :type comment* :relation blog))
(:ctor (author title text)))
;; generates add, delete, update, find and list methods over these classes.
(defcrud comment)
(defcrud blog)
(defcrud author)
(defapplication blog-app (http-application database-server)
()
(:default-initargs
:fqdn "blog"
:admin-email "[email protected]"
:database-directory #P"/tmp/db-blog-app/"
:auto-start t))
(defvar *app* (make-instance 'blog-app))
(deftransaction init-database ((self database))
(author.add self :name "evrim" :password "mypass" :email "[email protected]")
(author.add self :name "aycan" :password "mypass" :email "[email protected]"))
(defun userp ()
(query-session 'user))
(defun/cc blog/short (blog &optional (len 500))
(<:div :class "blog view"
:id (format nil "blog-~A" (get-id blog))
(<:div :class "title" (blog.title blog))
(<:div :class "author" (author.email (blog.author blog)) " - ")
(<:div :class "timestamp" (time->string (blog.timestamp blog) :long :en))
(let* ((blog-length (length (blog.text blog)))
(show-n (min blog-length len)))
(<:div :class "text" (subseq (blog.text blog) 0 show-n)
(if (> blog-length len)
"....")))))
(defun/cc blog/view (blog)
(<:div :class "blog view"
:id (format nil "blog-~A" (get-id blog))
(<:div :class "title" (blog.title blog))
(<:div :class "author" (author.email (blog.author blog)) " - ")
(<:div :class "timestamp" (time->string (blog.timestamp blog) :long :en))
(<:div :class "text" (blog.text blog))))
(defun/cc blog/edit (blog)
(<:div :class "blog edit"
:id (format nil "blog-~A" (get-id blog))
(<:form :method "POST"
:action (action/url ((author "author") (text "text") (title "title"))
(answer (list 'save :title title :text text :author (query-session 'user))))
(<:div :class "field title"
(<:div :class "description" "Title:")
(<:div :class "value" (<:input :type "text" :name "title" :value (blog.title blog))))
(<:div :class "field text"
(<:div :class "description" "Text:")
(<:script :type "text/javascript"
:src "http://tinymce.moxiecode.com/js/tinymce/jscripts/tiny_mce/tiny_mce.js")
(<:script :type "text/javascript" *tinymce-config*)
(<:div :class "value" (<:textarea :name "text" (blog.text blog))))
(<:div :class "submit" (<:input :type "submit" :value "Save")))))
(defun/cc blog/new ()
(blog/main
(<:h2 "Add a new blog")
(blog/edit (blog nil nil nil))))
(defun/cc blog/menu ()
(<:div :class "menu"
(<:ul
(<:li (<:a :href "index.core" "Blogs"))
(<:li (<:a :href (function/url () (answer 'new)) "Write"))
(<:li (if (userp)
(<:a :href (action/url ()
(update-session 'user nil)
(answer nil))
"Logout"))))))
(defun/cc blog/list (blogs &optional (n 20))
(<:div :class "list"
(<:h2 "Latest Blogs")
(<:ul
(mapcar #'(lambda (blog seq)
(<:li
(<:a :href (action/url () (answer (cons 'view blog)))
(blog.title blog))))
blogs (core-server::seq n)))))
(defun/cc auth/login ()
(<:div :class "login"
(<:form :method "POST"
:action (action/url ((email "email") (password "password"))
(answer (list 'auth/login :email email :password password)))
(<:div (<:p "Email:")
(<:p (<:input :type "text" :name "email")))
(<:div (<:p "Password:")
(<:p (<:input :type "text" :name "password")))
(<:div (<:input :type "submit" :value "Login")))))
(defun/cc blog/main (&rest body)
(<:html
(<:head
(<:title "CoreServer Blog Example")
(<:style :type "text/css" *blog-css*))
(<:body
(<:div :class "container"
(<:div :class "header" (<:h1 "CoreServer Blogs"))
(if (userp)
(blog/menu))
(<:div :class "right"
(blog/list (blog.list *app*))
(if (not (userp))
(auth/login)))
(<:div :class "left" body)
(<:div :class "footer"
(<:i "Blogs - 2008 © Core Server"))))))
;; entrypoint to our application
(defhandler "index.core" ((app blog-app) (blog "blog"))
(labels ((loopy (result)
(loopy
(send/suspend
(cond
((eq 'new result)
(blog/new))
((eq 'save (car result))
(apply #'blog.add (cons app (cdr result)))
(blog/main (mapcar #'blog/short (blog.list app))))
((eq 'view (car result))
(blog/main (blog/view (cdr result))))
((eq 'auth/login (car result))
(let ((user (apply #'author.find (cons app (cdr result)))))
(when user
(if (equal (author.password user) (getf (cdr result) :password))
(update-session 'user user)))
(loopy nil)))
(t
(blog/main (mapcar #'blog/short (blog.list *app*)))))))))
(loopy nil)))
(defparameter *blog-css*
"
* { margin:0; padding:0; }
html { margin:0; padding:0; }
h1 { padding-top:10px; padding-bottom:5px; }
h2 { padding-top: 5px; padding-bottom:2px; }
.body { margin:auto; width:100%;}
.container { margin:auto; width:80%; text-align:left;}
.left { float:left; width:70%;}
.right {float :right; }
.footer { clear: both; text-align:center; margin:5px; }
.menu { padding: 5px 0 5px 0; }
.menu ul { display:inline; }
.menu ul li { display: inline; }
.view .title { font-size: 1.5em; font-weight: bold; }
.view .author {float:left; padding:0 2px 0 0; }
.view .timestamp { }
.view .text { padding: 20px 0 5px 0; }
.edit .title .value input { width: 500px; padding:5px; font-size:1.5em; }
.edit .author .value input { padding:5px; width:300px;}
.edit .text .value textarea { width: 550px; padding:5px; }
.edit .submit input { background:transparent; padding:10px; margin:5px; margin-left:0; font-size:1.2em;}
.login .value input { padding:5px; font-size:1.5em; width:220px;}
.login .submit input { background:transparent; padding:10px; margin:5px; margin-left:0; font-size:1.2em;")
(defparameter *tinymce-config* "
tinyMCE.init({
// General options
mode : 'textareas',
theme : 'advanced',
plugins : 'safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template',
// Theme options
theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect',
theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor',
theme_advanced_buttons3 : 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen',
theme_advanced_buttons4 : 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak',
theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
theme_advanced_statusbar_location : 'bottom',
theme_advanced_resizing : true,
});
")
(register *server* *app*)
;; TODO: fix core-cps-io-stream of http context
;; TODO: fix session preservance via cookies
| 8,609 | Common Lisp | .lisp | 207 | 38.082126 | 255 | 0.6496 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | d89b16c98ce306e965658363a59b1ab9ad8f484f9878a7776bd7d3ce8e5a8cf7 | 8,203 | [
-1
] |
8,204 | handlers.lisp | evrim_core-server/examples/handlers.lisp | (in-package :core-server)
(defpackage :core-server.examples.web-handlers
(:nicknames :handlers)
(:use :cl :core-server :arnesi))
(in-package :handlers)
;; Note C-c C-k to load file.
(defapplication web-handlers-example (http-application)
()
(:default-initargs :fqdn "web-handlers"
:admin-email "[email protected]"
:htdocs-pathname "~/core-server/src/manager/wwwroot/"))
(defparameter *app* (make-instance 'web-handlers-example))
(register *server* *app*)
;; C-c M-p to change package.
;; C-x 1 to maximize buffer.
;; C-x C-f to open a file.
;; Open index.html.
;; Back to previous buffer C-x b RET
;; Define static handler
;; (defhandler/static #P "~/core-server/src/manager/wwwroot/index.html" "index.core")
;; Expand via C-c RET
;; Return via q
;; M-x slime-macroexpand-1-inplace
;; C-x u to undo.
;; C-M-6 to move up.
;; C-c C-c to compile.
;; C-k to delete line.
(defun make-index ()
(<:HTML
(HEAD (<:TITLE "Core Server - http://labs.core.gen.tr/")
(<:META :HTTP--EQUIV "Content-Type" :CONTENT
"text/html; charset=utf-8")
(<:LINK :REL "stylesheet" :HREF "style/reset.css")
(<:LINK :REL "stylesheet" :HREF "style/common.css")
(<:LINK :REL "stylesheet" :HREF "style/core.css")
(<:LINK :REL "stylesheet" :HREF "style/style.css")
(<:SCRIPT :SRC "library.core" :TYPE "text/javascript")
(<:SCRIPT :SRC "index.core" :TYPE "text/javascript")
(<:STYLE :TYPE "text/css" "body {background-color:#eee;}
.container {
padding-top:65px;
padding-bottom:35px;
background:url(../images/index-bg.jpg);
color:#fff;
}
.index-wrapper { color:#fff; padding-top:20px; }
.index-wrapper h3 { font-size:18px; margin-bottom:20px; }
.core-clock-widget { margin-top:15px; text-align:right; color:#000; }
.footer {background:transparent;}
.field .value span.validation { display:block; padding:5px 0; }
.field .value span.invalid { color:#ce0000; }
.field .value span.valid { color:#fff; }
"))
(<:BODY :CLASS "text-center"
(<:DIV :CLASS "container"
(<:DIV :CLASS "center max-width text-left header"
(<:DIV :CLASS "left" (<:H1 "[Core-serveR]")
(<:H2 "A Common-Lisp Application Server"))
(<:DIV :CLASS "right"
;; Add Clock
(<core:simple-clock :ID "clock"))
(<:DIV :CLASS "clear"))
(<:DIV :CLASS "pad10")
(<:DIV :CLASS "index-wrapper"
(<:DIV :CLASS "center max-width text-left"
;; Add Login Box
(<core:login :CLASS "text-left right" :ID "login")
(<:DIV :CLASS "left" (<:H3 "Welcome!")
(<:P
"Server documentation is located at: ")
(<:P
(<:A :TARGET "_blank" :HREF
"http://labs.core.gen.tr/"
"http://labs.core.gen.tr/ "))
(<:BR) (<:P "Follow us on Twitter!")
(<:P
(<:A :TARGET "_blank" :HREF
"http://twitter.com/core_server"
"http://twitter.com/core_server "))))
(<:DIV :CLASS "clear")))
(<:DIV :CLASS "max-width center text-center footer clear"
(<:DIV :CLASS "left" "© 2006-2012,
Kor Information Technologies Ltd.")
(<:DIV :CLASS "right"
(<:A :HREF "http://www.core.gen.tr/"
"http://www.core.gen.tr"))))))
;; Remember to compile C-c C-c
;; C-x C-s to save.
;; C-x 2 to divide.
;; C-x o to switch
;; C-c s r to REPL
;; C-c C-c
(defparameter +users+ '(("evrim". "core-server")
("aycan". "core-server")))
(defparameter +page+ (make-index))
;; C-c C-c
(defhandler "index.core" ((self web-handlers-example))
(destructuring-bind (username password) (send/suspend +page+)
(flet ((get-user ()
(let ((user (assoc username +users+ :test #'equal)))
(and user (equal password (cdr user))
user))))
(aif (get-user)
(continue/js
(progn
(update-session :user it)
(lambda (self k)
(k
(setf window.location.href "homepage.html")))))
(continue/js
(lambda (self k) (k nil)))))))
;; Navigate to your browser and open
;; http://localhost:8080/web-handlers/index.core
;; MARK 2
;; Core Server -- http://labs.core.gen.tr/
;; Documentation: http://labs.core.gen.tr/#web-handlers
;; Github https://github.com/evrim/core-server/
;; M-> to go to end.
;; C-c C-c to compile.
;; C-c s d to return to debugger.
;; 0 to exit debugger.
;; 1 to retry.
;; C-x C-s to save.
(defhandler "homepage.html" ((self web-handlers-example))
(<:html
(<:body
(<:h1 "Hello " (car (query-session :user)) "!"))))
;; PART 2
;; http://labs.core.gen.tr/#web-handlers-2
(defun/cc %write-page (stream)
(let ((clock (<core:simple-clock))
(login (<core:login)))
(with-js (clock login) stream
(let ((clock clock) (login login))
(add-on-load
(lambda ()
(clock (document.get-element-by-id "clock")
(lambda (clock)
(login (document.get-element-by-id "login")
(lambda (login)
(_debug "starting")))))))))))
;; See src/javascript/macro.lisp
;;
;; (defmacro rebinding-js (vars stream &body body)
;; (let ((vars (mapcar #'ensure-list vars)))
;; `(let (,@(reduce0 (lambda (acc a)
;; (if (null (cdr a))
;; acc
;; (cons a acc)))
;; (reverse vars)))
;; (with-js ,(mapcar #'car vars) ,stream
;; (let ,(mapcar (lambda (a) (list (car a) (car a))) vars)
;; (add-on-load
;; (lambda ()
;; ,@body)))))))
(defun/cc %%write-page (stream)
(rebinding-js ((clock (<core:simple-clock)) (login (<core:login))) stream
(clock (document.get-element-by-id "clock")
(lambda (clock)
(login (document.get-element-by-id "login")
(lambda (login)
(_debug "starting")))))))
;; See src/javascript/macro.lisp
;; (defmacro rebinding-js/cc (vars stream &body body)
;; `(rebinding-js ,vars ,stream
;; (with-call/cc ,@body)))
(defun/cc %%%write-page (stream)
(let ((clock (<core:simple-clock)))
(rebinding-js/cc (clock (login (<core:login))) stream
(call/cc clock (document.get-element-by-id "clock"))
(call/cc login (document.get-element-by-id "login")))))
(defhandler "index\.core" ((self web-handlers-example))
(destructuring-bind (username password) (javascript/suspend #'%%%write-page)
(flet ((get-user ()
(let ((user (assoc username +users+ :test #'equal)))
(and user (equal password (cdr user))
user))))
(aif (get-user)
(continue/js
(progn
(update-session :user it)
(lambda (self k)
(k
(setf window.location.href "homepage.html")))))
(continue/js
(lambda (self k) (k nil))))))) | 7,230 | Common Lisp | .lisp | 186 | 30.844086 | 85 | 0.552117 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | c1db2e78e1f48c0b0c8cdf6b357b43825104165cc79c12ebd98273d73aec6953 | 8,204 | [
-1
] |
8,205 | dict.lisp | evrim_core-server/examples/dict.lisp | ;; Two different methods for component usage
;;
;; Page Dependent:
;; http://localhost:8080/dict/dict.html
;;
;; Modular:
;; http://localhost:8080/dict/dict2.html
(defpackage :dict
(:use :cl :core-server :arnesi))
(in-package :dict)
(defapplication dictionary-application (http-application database-server)
()
(:default-initargs :fqdn "dict"
:auto-start t
:admin-email "[email protected]"))
(defvar *app* (make-instance 'dictionary-application))
;; ----------------------------------------------------------------------------
;; Dictionary of (key,val)
;; ----------------------------------------------------------------------------
(defclass+ dictionary (object-with-id)
((key :print t :host both)
(val :print t :host both)))
(defcrud dictionary)
;; +----------------------------------------------------------------------------
;; | Javascript Component for Dictionary
;; | * Page Dependent Version (see modular version)
;; +----------------------------------------------------------------------------
(defcomponent dictionary-component (<:div)
())
(defmethod/local lookup ((self dictionary-component) key)
(dictionary.find (component.application self) :key key))
(defmethod/local add ((self dictionary-component) key value)
(dictionary.add (component.application self) :key key :val value))
;; html response for testing dictionary
(defhandler "dict.html" ((self dictionary-application))
(<:html
(<:head
(<:script :type "text/javascript" :src "library.core"))
(<:body
(dictionary-component :id "dict")
(<:p "Add dictionary element")
(<:form :id "dict-add"
:action "#"
:onsubmit (js
(let ((comp (document.get-element-by-id "dict")))
(add comp this.key.value this.val.value)
(return false)))
(<:input :type "text" :name "key")
(<:input :type "text" :name "val")
(<:input :type "submit" :value "Add"))
(<:p "Lookup dictionary element")
(<:form :id "dict-lookup"
:action "#"
:onsubmit (js
(progn
(lookup (document.get-element-by-id "dict") this.key.value
(lambda (val)
(setf (slot-value (document.get-element-by-id "result") 'inner-h-t-m-l)
(slot-value val 'val))))
(return false)))
(<:input :type "text" :name "key")
(<:input :type "submit" :value "Lookup"))
(<:p "Value:" (<:span :id "result")))))
;; +----------------------------------------------------------------------------
;; | Another Javascript Component for Dictionary
;; | * Modular Javascript Version
;; +----------------------------------------------------------------------------
(defcomponent dictionary-component2 (<:div)
())
(defmethod/local lookup ((self dictionary-component2) key)
(dictionary.find (component.application self) :key key))
(defmethod/local add ((self dictionary-component2) key value)
(dictionary.add (component.application self) :key key :val value))
;; this returns a form for adding key,value pairs to the database
(defmethod/remote add-form ((self dictionary-component2))
(let ((key (<:input :type "text" :name "key"))
(val (<:input :type "text" :name "val")))
(<:form :id "dict-add"
:action "#"
:onsubmit (lambda (e)
(make-web-thread
(lambda () (add self (slot-value key 'value) (slot-value val 'value))))
false)
key val (<:input :type "submit" :value "Add"))))
;; this returns a form for querying keys
(defmethod/remote find-form ((self dictionary-component2))
(let ((key (<:input :type "text" :name "key")))
(<:form :id "dict-lookup"
:action "#"
:onsubmit (lambda (e)
(let ((key (slot-value key 'value)))
(make-web-thread
(lambda ()
(setf (slot-value (document.get-element-by-id "result") 'inner-h-t-m-l)
(slot-value (lookup self key) 'val)))))
false)
key
(<:input :type "submit" :value "Lookup"))))
;; organization of elements in a page
(defmethod/remote template ((self dictionary-component2))
(list (<:p "Add dictionary element")
(add-form self)
(<:p "Lookup dictionary element")
(find-form self)
(<:p "Value:" (<:span :id "result"))))
;; automatically executed upon initialization of the component
(defmethod/remote init ((self dictionary-component2))
(mapcar (lambda (a) (.append-child self a)) (template self)))
(defhandler "dict2.html" ((self dictionary-application))
(<:html
(<:head
(<:script :type "text/javascript" :src "library.core"))
(<:body
(dictionary-component2 :id "dict"))))
(register *server* *app*) | 4,668 | Common Lisp | .lisp | 115 | 35.686957 | 80 | 0.576694 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | a3ec850fb484f4b7637b9fd88780d559c250428cde6a521b8ecd4fbeada4e6ae | 8,205 | [
-1
] |
8,206 | resource-protector.lisp | evrim_core-server/examples/resource-protector.lisp | (in-package :core-server)
;; Demonstration of core-server units
;;
;; Protection for concurrent access to a single resource
(defclass resource-protector (local-unit)
((resource :accessor resource-protector.resource :initarg :resource)))
(defmethod/unit protected-access :sync ((self resource-protector) fun)
(prog1
(setf (resource-protector.resource self)
(funcall fun (resource-protector.resource self)))
(describe (resource-protector.resource self))))
(defmacro defprotected (resource)
(let ((sym (gensym)))
`(let ((,sym (make-instance 'resource-protector :resource ,resource)))
(start ,sym)
(cons
(lambda (fun)
(protected-access ,sym fun))
(lambda ()
(stop ,sym)
(setf ,sym nil))))))
(defun test-protector ()
(let* ((protector (defprotected 0))
(accessor (car protector))
(destructor (cdr protector)))
(labels ((fwd (i)
(funcall accessor #'(lambda (x) (+ i x))))
(rwd (i)
(funcall accessor #'(lambda (x) (- x i))))
(l00p (i)
(cond
((< i 1) (funcall accessor #'identity))
(t
(progn
(thread-spawn (lambda () (fwd 2)))
(thread-spawn (lambda () (rwd 1)))
(l00p (- i 1)))))))
(prog1 (l00p 10)
(funcall destructor)))))
;; 2 is a (INTEGER 0 1152921504606846975).
;; 1 is a BIT.
;; 3 is a (INTEGER 0 1152921504606846975).
;; 2 is a (INTEGER 0 1152921504606846975).
;; 4 is a (INTEGER 0 1152921504606846975).
;; 3 is a (INTEGER 0 1152921504606846975).
;; 5 is a (INTEGER 0 1152921504606846975).
;; 4 is a (INTEGER 0 1152921504606846975).
;; 6 is a (INTEGER 0 1152921504606846975).
;; 5 is a (INTEGER 0 1152921504606846975).
;; 7 is a (INTEGER 0 1152921504606846975).
;; 6 is a (INTEGER 0 1152921504606846975).
;; 8 is a (INTEGER 0 1152921504606846975).
;; 7 is a (INTEGER 0 1152921504606846975).
;; 9 is a (INTEGER 0 1152921504606846975).
;; 8 is a (INTEGER 0 1152921504606846975).
;; 10 is a (INTEGER 0 1152921504606846975).
;; 9 is a (INTEGER 0 1152921504606846975).
;; 11 is a (INTEGER 0 1152921504606846975).
;; 10 is a (INTEGER 0 1152921504606846975).
;; 10 is a (INTEGER 0 1152921504606846975).
| 2,133 | Common Lisp | .lisp | 60 | 32.25 | 74 | 0.6794 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | e2da17a84989ea0686673ec46a98e6b0776e67ea3517f5dbfe3c27fd335e7565 | 8,206 | [
-1
] |
8,207 | relations.lisp | evrim_core-server/examples/relations.lisp | ;; A simple example demonstrating relations between objects
;;
;;
;; (progn (test *db*) (list *db*))
(defpackage :relations
(:use :cl :core-server :arnesi))
(in-package :relations)
(defclass+ category (object-with-id)
((objects :type cobject* :relation category)
(label :print t)))
(defclass+ cobject (object-with-id)
((category :type category :relation objects)
(name :print t)))
(defcrud category)
(defcrud cobject)
(defparameter *db*
(make-instance 'database-server
:database-directory #P"/tmp/relations/"
:auto-start t))
(defun make-new-category (db label objs)
(let ((cat (category.add db :label label)))
(mapcar #'(lambda (c)
(cobject.add db :name c :category cat))
objs)))
(defun test (db)
(start db)
(make-new-category db "Alphabet" (list #\A #\B #\C #\D #\E #\F))
(make-new-category db "Numbers" (list 1 2 3 4 5 6))
(stop db))
(defun list-db (db)
(start db)
(mapcar #'describe (cobject.list db))
(stop db))
| 993 | Common Lisp | .lisp | 33 | 26.757576 | 66 | 0.662461 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 8ec037f16b8623fbd2f91a12345f336d922e2b3d7ccc80d3c9bff1e1e2deb687 | 8,207 | [
-1
] |
8,208 | guestbook.lisp | evrim_core-server/examples/guestbook.lisp | ;; A persistent guestbook web application
;; Just compile it with C-c C-k or load it with C-c C-l and then visit
;; http://localhost:8080/guestbook/guestbook
(defpackage :guestbook
(:use :cl :core-server :arnesi))
(in-package :guestbook)
;; a class for messages and a constructor
(defclass+ message ()
((sender)
(subject)
(text)
(timestamp :initform (get-universal-time))))
(defcrud message)
(defapplication guestbook-application (http-application database-server)
()
(:default-initargs
:fqdn "guestbook"
:admin-email "[email protected]"
:database-directory #P"/tmp/guestbook/"
:auto-start t))
(defparameter *guestbook* (make-instance 'guestbook-application))
(defparameter *text/css* ".message ul { list-style: none; margin:0; padding: 0 0 15px 0;}")
;; Our template function which gets body as a parameter
(defun/cc template (body)
(<:html
(<:head
(<:meta :http--equiv "Content-Type" :content "text/html; charset=utf-8")
(<:style :type "text/css" *text/css*))
(<:body
body)))
;; render a message as html
(defun/cc render-message (msg)
(with-slots (sender subject text timestamp) msg
(<:div :class "message"
(<:ul
(<:li (<:p sender ": " subject))
(<:li (<:p text))
(<:li (<:p (time->string timestamp)))))))
;; A function which shows guestbook messages.
(defun/cc guestbook/messages ()
(template
(<:div :id "body"
(<:a :href (action/url ()
(let ((params (send/suspend (guestbook/add))))
(apply #'message.add *guestbook* params)
(send/suspend (guestbook/messages))))
"Add message")
(<:div :id "messages"
(mapcar #'(lambda (item) (render-message item))
(message.list *guestbook*))))))
;; A form for new messages
(defun/cc guestbook/add ()
(template
(<:form :action (action/url ((sender "sender") (subject "subject") (text "text"))
(answer (list :sender sender :subject subject :text text)))
:method "POST"
(<:table
(<:tr (<:td "Who are you:")
(<:td (<:input :size "40" :name "sender")))
(<:tr (<:td "Subject:") (<:td (<:input :size "40" :name "subject")))
(<:tr (<:td :valign "top" "Message: ") (<:td (<:textarea :rows "10" :cols "40" :name "text" "")))
(<:tr (<:td :colspan "2"
(<:input :type "submit" :value "Sign Guestbook")))))))
;; http://localhost:8080/guestbook/guestbook
(defhandler "guestbook" ((self guestbook-application))
(guestbook/messages))
(register *server* *guestbook*)
(start *guestbook*) | 2,482 | Common Lisp | .lisp | 68 | 32.838235 | 102 | 0.649605 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 3a23067b375ca6691d3c87cb4b54bf93532fb577fa6e4d19620c5c54753459b9 | 8,208 | [
-1
] |
8,209 | websum.lisp | evrim_core-server/examples/websum.lisp | ;; -------------------------------------------------------------------------
;; [Core-serveR] Web Sum Example
;; -------------------------------------------------------------------------
;; Load the file with C-c C-l and visit,
;; http://localhost:8080/websum/
;; -------------------------------------------------------------------------
;; Define a new namespace
;; -------------------------------------------------------------------------
(defpackage :websum
(:use :cl :core-server :arnesi))
;; -------------------------------------------------------------------------
;; Switch to new namespace
;; -------------------------------------------------------------------------
(in-package :websum)
;; -------------------------------------------------------------------------
;; Web Sum Application Definition
;; -------------------------------------------------------------------------
(defapplication websum-application (http-application)
()
(:default-initargs :fqdn "websum" :admin-email "[email protected]"))
;; -------------------------------------------------------------------------
;; Define 'page' function which gets body as a parameter
;; -------------------------------------------------------------------------
(defun/cc page (body)
(<:html (<:head
(<:meta :http--equiv "Content-Type" :content "text/html; charset=utf-8")
(<:title "[Core-serveR] - Web Sum Example"))
(<:body
(<:h1 "[Core-serveR] - Web Sum Example")
body)))
;; -------------------------------------------------------------------------
;; Display the result
;; -------------------------------------------------------------------------
(defun/cc web-display (num)
(send/suspend
(page
(<:div
(<:p (format nil "The result is ~D" num))
(<:a :href "index" "Restart")))))
;; -------------------------------------------------------------------------
;; Read an integer
;; -------------------------------------------------------------------------
(defun/cc web-read (msg)
(send/suspend
(page
(<:form :method "POST"
:action (action/url ((num "num"))
(answer (parse-integer num :junk-allowed t)))
(<:p msg)
(<:input :type "text" :name "num")
(<:input :type "submit" :value "Next")))))
;; -------------------------------------------------------------------------
;; Register a handler
;; -------------------------------------------------------------------------
(defhandler "index" ((self websum-application))
(web-display (+ (web-read "Enter first number to add:")
(web-read "Enter a second Number:"))))
;; -------------------------------------------------------------------------
;; Create an application instance
;; -------------------------------------------------------------------------
(defparameter *websum* (make-instance 'websum-application))
;; -------------------------------------------------------------------------
;; Register our application to the server
;; -------------------------------------------------------------------------
;; (register *server* *websum*)
;; EoF
| 3,063 | Common Lisp | .lisp | 66 | 43.727273 | 76 | 0.323067 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 30d1bf94ac01979a6936c7cadd13efd5cb3bddf8924d5462d6fe6b2b7aecc61c | 8,209 | [
-1
] |
8,210 | addressbook.lisp | evrim_core-server/examples/addressbook.lisp | ;; Address Book Example
;; ------------------------------------
;; Sample Database Server Demonstration
(defpackage :addressbook
(:use :cl :core-server :arnesi))
(in-package :addressbook)
(defclass+ person ()
((fullname :index t)
(fields)
(ctime :initform (get-universal-time))))
(defcrud person)
(defparameter *addressbook*
(make-instance 'database-server
:database-directory #P"/tmp/addressbook/"
:auto-start t))
;; Test
(defun test-book-1 (book)
(let ((person (person.add book
:fullname "Johny Doe"
:fields '((home-phone "555-1212")
(mobile-phone "555-1313")
(address "Acme St. NY, USA")
(email "[email protected]")))))
(describe (person.find book :fullname "Johny Doe"))
(setq person (person.update book person :fullname "John Doe"))
(describe (person.find book :fullname "John Doe")))
(snapshot book))
| 893 | Common Lisp | .lisp | 27 | 28.962963 | 66 | 0.644186 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | fab2a2c3bae581b1f06b31d8b5394f8bbec7bb81557d35b4ed3963d30605e9af | 8,210 | [
-1
] |
8,211 | file-upload.lisp | evrim_core-server/examples/file-upload.lisp | ;; File upload example
;; http://localhost:8080/fupload/upload
(defpackage :fupload
(:use :cl :core-server :arnesi))
(in-package :fupload)
;; Create an application
(defparameter *fupload-app*
(make-instance 'http-application
:fqdn "fupload"
:admin-email "[email protected]"))
;; Render a page
(defun/cc page (body)
(<:html
(<:head
(<:meta :http--equiv "Content-Type" :content "text/html; charset=utf-8"))
(<:body
body)))
;; Read a text and a file
(defun/cc read-file (msg)
(send/suspend
(page
(<:form :enctype "multipart/form-data"
:method "POST"
:action (action/url ((descr "descr") (photo "photo"))
(answer (cons descr photo)))
(<:p msg)
(<:input :type "text" :name "descr")
(<:input :type "file" :name "photo")
(<:input :type "submit" :value "Send")))))
;; Preview image with inline image tag.
(defun/cc preview (media)
(send/suspend
(page
(<:div :id "frame"
(<:p (car media))
;; Preview with an inline image: <IMG SRC=\"data:image/jpg;base64,[...]\">
(<:img :src (cdr media) :alt "Preview image")
;; Save file to "/tmp/"
(<:form :method "POST"
:action (action/url ()
(let* ((tlm (cdr media))
(path (pathname (format nil "/tmp/~A" (mime.filename tlm)))))
(mime.serialize tlm path))
(answer t))
(<:input :type "submit" :name "save" :value "Save"))
;; Cancel operation
(<:form :method "POST"
:action (action/url () (answer nil))
(<:input :type "submit" :value "Cancel"))))))
(defun/cc result-page (msg)
(send/suspend
(page
(<:div
(<:a :href "/fupload/upload" "Return to Main")
(<:p msg)))))
;; Register a handler
(defhandler "upload" ((self http-application))
(result-page
(if (preview (read-file "Send us your photo with a description line:"))
"File saved succesfuly."
"Operation cancelled.")))
;; Register our application to the server
(register *server* *fupload-app*) | 2,002 | Common Lisp | .lisp | 63 | 27.142857 | 79 | 0.613154 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | b676b9937e1deb95aa958146a3bf174830821ad55ba9409d53808307484e74de | 8,211 | [
-1
] |
8,212 | jsguestbook.lisp | evrim_core-server/examples/jsguestbook.lisp | ;; A persistent guestbook component
;; Just compile it with C-c C-k or load it with C-c C-l and then visit
;; http://localhost:8080/jsguestbook/index.html
(defpackage :jsguestbook
(:use :cl :core-server :arnesi))
(in-package :jsguestbook)
(defapplication jsguestbook-app (http-application database-server)
()
(:default-initargs :fqdn "jsguestbook"
:admin-email "[email protected]"
:database-directory #P"/tmp/jsguestbook/"
:auto-start t))
(defparameter *app* (make-instance 'jsguestbook-app))
;; a class for messages
(defclass+ message (object-with-id)
((sender :print t :host both)
(subject :print t :host both)
(text :host both)
(timestamp :initform (get-universal-time))))
(defcrud message)
;; Our component will be in a div element and it has no slots
(defcomponent guestbook-component (<:div)
())
(defmethod/local send-message ((self guestbook-component) sender subject text)
(message.add (component.application self) :sender sender :subject subject :text text))
(defmethod/local get-messages ((self guestbook-component))
(message.list (component.application self)))
(defmethod/remote add-form ((self guestbook-component))
(<:div :id "add-form"
(<:h1 "Sign the guestbook:")
(<:form :id "send-message"
:action "#"
:onsubmit (event (ev)
(with-call/cc
(send-message self this.sender.value this.subject.value this.text.value)
(replace-node (document.get-element-by-id "show-guestbook")
(show-guestbook self)))
false)
(<:p "Sender: " (<:input :type "text" :name "sender"))
(<:p "Subject: " (<:input :type "text" :name "subject"))
(<:p "Message: " (<:textarea :rows "10" :cols "40" :name "text"))
(<:input :type "submit" :value "Sign Guestbook"))))
(defmethod/remote show-guestbook ((self guestbook-component))
(<:div :id "show-guestbook"
(<:h1 "Guestbook Messages:")
(<:table :id "messages"
(mapcar (lambda (m)
(list
(<:tr (<:td "From: ")
(<:td (unescape (slot-value m 'sender))))
(<:tr (<:td "Subject: ")
(<:td (unescape (slot-value m 'subject))))
(<:tr (<:td :colspan "2" (unescape (slot-value m 'text))))
(<:tr (<:td :colspan "2" (<:hr)))))
(get-messages self)))))
(defmethod/remote init ((self guestbook-component))
(mapcar (lambda (e) (self.append-child e))
(list (add-form self)
(show-guestbook self))))
(defhandler "index.html" ((self jsguestbook-app))
(<:html
(<:head
(<:meta :http--equiv "Content-Type" :content "text/html; charset=utf-8")
(<:script :type "text/javascript" :src "library.core"))
(<:body
(guestbook-component :id "guestbook"))))
(register *server* *app*) | 2,923 | Common Lisp | .lisp | 67 | 36.014925 | 88 | 0.607457 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 378a23fbc3c902125919556d011873c9bb9ffbeb2a51ecd0f6a507a383a3fa79 | 8,212 | [
-1
] |
8,213 | bootstrap.lisp | evrim_core-server/src/bootstrap.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :cl-user)
(require :asdf)
(defpackage :tr.gen.core.server.bootstrap
(:nicknames :bootstrap)
(:use :cl)
(:export
#:home
#:in-home
#:set-env-var
#:use-nil
#:register-libs
#:register-projects
#:environment-variable-not-found))
(in-package :bootstrap)
(defparameter +verbose+ t)
(defmacro msg (&body body)
`(when +verbose+
,@body))
(define-condition environment-variable-not-found (error)
((var :initarg :var :reader var))
;; (:report (lambda (c s)
;; (format s "Environment variable ~A not set." (var c))))
)
(defmethod print-object ((o environment-variable-not-found) s)
(print-unreadable-object (o s :type t :identity t)
(format s "var:~A" (var o))))
;; (defun set-environment-variable (c)
;; (declare (ignorable c))
;; (let ((restart (find-restart 'set-environment-variable)))
;; (when restart (invoke-restart restart))))
(defun getenv (var)
(let ((var #+sbcl (sb-posix:getenv var)
#+cmucl (cdr (assoc var ext:*environment-list*))))
(if (or (null var) (equal var "")) nil var)))
(defun setenv (var val)
#+sbcl
(sb-posix:putenv (format nil "~A=~A" var val))
#+cmucl
(setf ext:*environment-list* (cons (cons var val) ext:*environment-list*)))
(defun coreserver-home-aux (var)
(restart-case (or (getenv var)
(error 'environment-variable-not-found :var var))
(set-env-var (val)
:report (lambda (s) (format s "Specify a value for ~A" var))
:interactive (lambda ()
(format t "Enter value:")
(list (read)))
(setenv var val)
val)
(use-nil ()
:report (lambda (s) (format s "Use NIL as a return value"))
nil)))
(defun home (&optional (var "CORESERVER_HOME"))
"Get the value of the environment variable CORESERVER_HOME"
(coreserver-home-aux var))
(defun in-home (pathname)
"Prepends (coreserver-home) to the given pathname"
(merge-pathnames pathname (home)))
(defun register-libs (&optional (path #P"lib/systems/"))
(msg (format t "Registering Libraries to asdf::*central-registry*.~%"))
(pushnew (in-home path) asdf:*central-registry* :test #'equal))
(defun register-projects (&optional (path #P"projects/"))
(msg (format t "Registering Projects to asdf::*central-registry*.~%"))
(flet ((push-all (systems-dir)
(dolist
(dir-candidate
(directory (concatenate 'string (namestring systems-dir) "*/")))
(let ((name (car (last (pathname-directory dir-candidate)))))
(unless (equal #\_ (elt name 0))
(pushnew dir-candidate asdf:*central-registry* :test 'equal))))))
(push-all (in-home path))))
;; Add ssl to *features*
(if (find-package :cl+ssl) (pushnew :ssl *features*)) | 3,424 | Common Lisp | .lisp | 85 | 36.882353 | 77 | 0.683735 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | ec374c1d008a073dfdf9b6290840187ad1819677f5bfe4d48bb5f15051ace303 | 8,213 | [
-1
] |
8,214 | server.lisp | evrim_core-server/src/server.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :tr.gen.core.server)
;;+----------------------------------------------------------------------------
;;| Server Implementation
;;+----------------------------------------------------------------------------
(defclass+ server ()
((name :accessor server.name :initarg :name :initform "Abstract Server"
:documentation "Name of the server" :host local)
(mutex :accessor server.mutex :initarg :mutex :initform (sb-thread:make-mutex :name "Server mutex")
:documentation "Lock used to synchronize some operations on server"
:host none)
(auto-start :accessor server.auto-start :initarg :auto-start :initform nil
:documentation "If t, the server would be started when created"
:host local)
(debug :accessor server.debug :initarg :debug :initform t
:documentation "Debugging flag of generic server"
:host local))
(:documentation "Server Base Class"))
(defmethod print-object ((self server) stream)
(print-unreadable-object (self stream :type t :identity t)
(format stream "\"~A\" is~A running." (server.name self)
(if (status self) "" " *not*"))))
(defmacro with-server-mutex (server &body body)
"Execute 'body' while holding 'server' lock"
`(sb-thread:with-recursive-lock ((server.mutex ,@server))
,@body))
(defmacro with-server-lock (server &body body)
"Execute 'body' while holding 'server' lock"
`(sb-thread:with-recursive-lock ((server.mutex ,@server))
,@body))
(defmacro defsynhronized (name args &body body)
`(progn
(redefmethod ,name :around ,args
(with-server-lock (,(caar args))
(call-next-method)))
(redefmethod ,name ,args ,@body)))
;; +----------------------------------------------------------------------------
;; | Auto Start Feature for Servers
;; +----------------------------------------------------------------------------
(defmethod shared-initialize :after ((self server) slot-name &rest initargs
&key &allow-other-keys)
(declare (ignore initargs))
(when (server.auto-start self)
(start self)))
;;-----------------------------------------------------------------------------
;; Wrapper :around methods for protocol
;;-----------------------------------------------------------------------------
;;
;; They wrap protocol methods to detect errors and implement appropriate
;; restarts.
;;
(defmethod start :around ((self server))
(with-server-mutex (self)
(let ((failed))
(unwind-protect
(restart-case
(let ((swank::*sldb-quit-restart* 'give-up))
(setf failed t)
(multiple-value-prog1 (call-next-method)
(setf failed nil)))
(give-up ()
:report "Give up starting server."
(format t "Giving up.~%"))
(try-again ()
:report "Try again."
(start self)))
(when failed
(format t "stopping server.~%")
(stop self))))))
(defmethod stop :around ((self server))
(with-server-mutex (self)
(call-next-method)))
(defmethod register :around ((self server) (app application))
(with-server-mutex (self)
(let ((failed))
(unwind-protect
(restart-case
(let ((swank::*sldb-quit-restart* 'give-up))
(setf failed t)
(call-next-method)
(setf failed nil)
(setf (application.server app) self))
(give-up ()
:report "Give up registering app."
(format t "Giving up.~%"))
(try-again ()
:report "Try again."
(start self)))
(when failed
(format t "Unregistering application.")
(unregister self app))))))
(defmethod unregister :around ((self server) (app application))
(call-next-method)
(setf (application.server app) nil))
(defmethod shared-initialize :after ((self server) slot-names
&rest initargs &key &allow-other-keys)
"If auto-start slot of the server is t, start server"
(declare (ignore initargs))
(when (s-v 'auto-start)
(start self)))
(defmethod stop-start ((self server)) (stop self) (start self))
;; +-------------------------------------------------------------------------
;; | Web Server
;; +-------------------------------------------------------------------------
(defclass+ web-server (server)
()
(:documentation "Web Server Base Class"))
| 4,896 | Common Lisp | .lisp | 118 | 37.855932 | 102 | 0.603488 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 8f40077b38f3d81fad94d5eb2db16449ef5121da20b7382c457b0e8457cd1172 | 8,214 | [
-1
] |
8,215 | protocol.lisp | evrim_core-server/src/protocol.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :tr.gen.core.server)
;;+----------------------------------------------------------------------------
;;| Server Protocols
;;+----------------------------------------------------------------------------
;;-----------------------------------------------------------------------------
;; Generic Server Protocol
;;-----------------------------------------------------------------------------
(defgeneric start (server)
(:documentation "Starts the server. This method is surrounded by server.mutex")
(:method-combination sysv-standard :type :start)
(:method ((server null)) t)
(:method ((server t)) t))
(defgeneric stop (server)
(:documentation "Stops the server. This method is surrounded by server.mutex")
(:method-combination sysv-standard :type :stop)
(:method ((server null)) t)
(:method ((server t)) t))
(defgeneric status (server)
(:documentation "Returns t if server is running, nil otherwise.")
(:method-combination sysv-standard :type :status)
(:method ((server null)) t)
(:method ((server t)) t))
(defgeneric register (server app)
(:documentation "Deploys an application to server. This method
is surrounded by server.mutex")
(:method-combination sysv-standard :type :register)
(:method ((server null) (app null)) app)
(:method ((server t) (app t)) app))
(defgeneric unregister (server app)
(:documentation "Undeploys an application from a server. This
method is surrounded by server.mutex")
(:method-combination sysv-standard :type :unregister)
(:method ((server null) (app null)) app)
(:method ((server t) (app t)) app))
;;-----------------------------------------------------------------------------
;; Name-server Protocol
;;-----------------------------------------------------------------------------
(defgeneric tinydns-server.domains (server)
(:documentation "Returns raw domain data"))
(defgeneric find-record (server fqdn)
(:documentation "Finds any record relating to fqdn"))
(defgeneric find-a (server fqdn)
(:documentation "Finds A type records for fqdn"))
(defgeneric find-ns (server fqdn)
(:documentation "Finds NS type records for fqdn"))
(defgeneric find-mx (server fqdn)
(:documentation "Find mX type records for fqdn"))
(defgeneric add-mx (server fqdn &optional ip)
(:documentation "Adds new mX type record to the database"))
(defgeneric add-ns (server fqdn ip)
(:documentation "Adds new NS type record to the database"))
(defgeneric add-host (server fqdn ip)
(:documentation "Adds new A type record to the database"))
(defgeneric add-alias (server fqdn ip)
(:documentation "Adds new ALIAS type record to the database"))
(defgeneric find-a (server fqdn)
(:documentation "Returns A records of 'fqdn'"))
(defgeneric find-alias (server fqdn)
(:documentation "Returns ALIAS records of 'fqdn'"))
(defgeneric find-ns (server fqdn)
(:documentation "Returns NS records of 'fqdn'"))
(defgeneric find-mx (server fqdn)
(:documentation "Returns MX records of 'fqdn'"))
;;-----------------------------------------------------------------------------
;; Logger Server Protocol
;;-----------------------------------------------------------------------------
(defgeneric log-me (server tag message)
(:documentation "Log messages as '<time> <tag> <message>'"))
(defgeneric log-me-raw (server message)
(:documentation "Log messages as '<message>'"))
;;-----------------------------------------------------------------------------
;; Ticket Server Protocol
;;-----------------------------------------------------------------------------
(defgeneric add-ticket (server hash type &optional used)
(:documentation "Add ticket to the server"))
(defgeneric generate-tickets (server amount type)
(:documentation "Generate given amount of tickets with random hash"))
;;-----------------------------------------------------------------------------
;; Socket Server Protocol
;;-----------------------------------------------------------------------------
(defgeneric handle-stream (unit core-stream address)
(:documentation "Handle the incoming remote socket request"))
;;+----------------------------------------------------------------------------
;;| Application Protocol
;;+----------------------------------------------------------------------------
;;-----------------------------------------------------------------------------
;; Serializable Application Protocol
;;-----------------------------------------------------------------------------
(defgeneric serialize-source (app symbol)
(:documentation "Serialize a new source for application")
(:method ((self null) symbol) t))
(defgeneric serialize-asd (app)
(:documentation "Serialize system definition"))
(defgeneric source-to-pathname (app symbol)
(:documentation "todo"))
(defgeneric serialize (app)
(:documentation "Serialize application to project path"))
(defgeneric package-keyword (app &optional long)
(:documentation "Package name for our new application"))
(defgeneric src/packages (app)
(:documentation "Returns src/packages.lisp sexp"))
(defgeneric src/model (app)
(:documentation "Returns src/model.lisp sexp"))
(defgeneric src/tx (app)
(:documentation "Returns src/tx.lisp sexp"))
(defgeneric src/interfaces (app)
(:documentation "Returns src/interfaces.lisp sexp"))
(defgeneric src/application (app)
(:documentation "Returns src/application.lisp sexp"))
(defgeneric src/security (app)
(:documentation "Returns src/security.lisp sexp"))
(defgeneric src/ui/main (app)
(:documentation "Returns src/ui/main.lisp sexp"))
;;-----------------------------------------------------------------------------
;; HTTP Application Protocol
;;-----------------------------------------------------------------------------
(defgeneric find-session (application id)
(:documentation "Returns 'http-session' associated with 'id'"))
(defgeneric find-continuation (application id)
(:documentation "Returns (values continuation session) associated with 'id'"))
(defgeneric register-url (application regexp-url lambda)
(:documentation "Registers 'regexp-url' to be handled by
one-arg (context) lambda"))
(defgeneric unregister-url (application regexp-url)
(:documentation "Unregisters 'regexp-url' handler")) | 6,966 | Common Lisp | .lisp | 137 | 48.671533 | 81 | 0.597583 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 720acaaed7d689f53738d8626661930819a7be3cbaa297b2b852aa52db903317 | 8,215 | [
-1
] |
8,216 | vars.lisp | evrim_core-server/src/vars.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :tr.gen.core.server)
;;+--------------------------------------------------------------------------
;;| Standard Global Variables
;;+--------------------------------------------------------------------------
;;
;; This file contains system specific global variables.
(defun load-end.lisp (&rest args)
(declare (ignore args))
(load (merge-pathnames "etc/end.lisp"
(bootstrap:home))))
#+sbcl
(progn
(require :sb-posix)
(sb-unix::enable-interrupt sb-posix:sigterm #'core-server::load-end.lisp)
(with-open-file (s (merge-pathnames #P"var/core-server.pid"
(bootstrap:home))
:direction :output :if-exists :supersede
:if-does-not-exist :create)
(format s "~D" (sb-posix:getpid))))
;; --------------------------------------------------------------------------
;; Temporary Directory
;; --------------------------------------------------------------------------
(defparameter +tmp+ (make-pathname :directory '(:absolute "tmp"))
"Temporary directory")
;;---------------------------------------------------------------------------
;; Unix Commands
;;---------------------------------------------------------------------------
;;
;; You must add your use to your /etc/sudoers file with visudo like:
;; evrim: ALL= NOPASSWD: ALL
;;
(defvar +sudo+ (whereis "sudo") "Sudo Pathname")
(defvar +cp+ (whereis "cp") "cp Pathname")
(defvar +chown+ (whereis "chown") "chown Pathname")
(defvar +chmod+ (whereis "chmod") "chmod Pathname")
(defvar +find+ (whereis "find") "find Pathname")
(defvar +rm+ (whereis "rm") "rm Pathname")
(defvar +mkdir+ (whereis "mkdir") "mkdir Pathname")
(defvar +sed+ (whereis "sed") "sed Pathname")
;;---------------------------------------------------------------------------
;; Apache Specific Variables
;;---------------------------------------------------------------------------
(defvar *apache-default-config-extenstion* "conf"
"Apache Configuration File Extension")
(defvar +apache-user+ #-debian "apache" #+debian "www-data"
"The user that Apache runs as")
(defvar +apache-group+ #-debian "apache" #+debian "www-data"
"The group that Apache runs as")
;;---------------------------------------------------------------------------
;; Postfix Specific Variables
;;---------------------------------------------------------------------------
(defvar +postmap+ (which :name "postmap" :errorp nil))
;;---------------------------------------------------------------------------
;; DNS Specific Variables
;;---------------------------------------------------------------------------
(defvar +ns1+ "139.179.139.251"
"IP address of the first nameserver")
(defvar +ns2+ "212.175.40.11"
"IP address of the second nameserver")
(defvar +mx+ "212.175.40.55"
"IP address of the mail exchanger")
;;---------------------------------------------------------------------------
;; SCM Specific Variables
;;---------------------------------------------------------------------------
(defvar +darcs+ (whereis "darcs") "darcs Pathname")
(defvar +git+ #P"/usr/bin/git" "git Pathname") ;; can't be found on all
(defvar +remote-user+ "evrim.ulu"
"Default ssh username for application sharing, see darcs-application.share")
;;---------------------------------------------------------------------------
;; Web Specific Variables
;;---------------------------------------------------------------------------
(defvar +loading-gif+ "style/images/loading.gif")
(defvar +default-extension+ ".core" "Web application default extension")
;; -------------------------------------------------------------------------
;; JQuery Variables
;; -------------------------------------------------------------------------
(defvar +jquery.js+ "/js/jquery.min.js")
(defvar +jquery-ui.js+ "/js/jquery-ui.min.js")
(defvar +jquery-ui.css+ "/js/jquery-ui/css/blitzer/jquery-ui.custom.css")
(defvar +jquery-lightbox.js+ "/js/lightbox/js/jquery.lightbox-0.5.min.js")
(defvar +jquery-lightbox.css+ "/js/lightbox/css/jquery.lightbox-0.5.css")
(defvar +jquery-carousel.js+ "/js/jcarousel/lib/jquery.jcarousel.min.js")
(defvar +jquery-carousel.css+ "/js/jcarousel/skins/tango/skin.css")
(defvar +jquery-nested-sortable.js+ "/js/nested-sortable/jquery.ui.nestedSortable.js")
(defvar +jquery-newsticker.js+ "/js/jquery.newsTicker.js")
(defvar +jquery-slider.js+ "/js/slider/slider.js")
(defvar +jquery-slider.css+ "/js/slider/slider.css")
(defvar +jquery-text-effects.js+ "/js/slider/jquery.text-effects.js")
(defvar +jquery-tree.js+ "/js/jquery-tree/jquery.tree.js")
(defvar +jquery-cookie.js+ "/js/jquery-tree/jquery.cookie.js")
(defvar +jquery-date-time-picker.js+ "/js/jquery-ui-timepicker-addon.js")
(defvar +jquery-date-time-picker.css+ "/js/jquery-ui-timepicker-addon.css")
(defvar +ckeditor.js+ "/js/ckeditor/ckeditor.js")
(defvar +ckeditor-source.js+ "/js/ckeditor/ckeditor_source.js")
(defvar +ckeditor.css+ "/style/ckeditor.css")
;; -------------------------------------------------------------------------
;; Component Specific Stylesheets
;; -------------------------------------------------------------------------
(defvar +theme-root+ "style/themes/")
(defvar +default-theme+ "default")
(defvar +core.css+ "style/core.css")
(defvar +tab.css+ "style/tab.css")
(defvar +console.css+ "style/console.css")
(defvar +toaster.css+ "style/toaster.css")
(defvar +taskbar.css+ "style/taskbar.css")
(defvar +sidebar.css+ "style/sidebar.css")
(defvar +page-plugin.css+ "style/page.css")
(defvar +table.css+ "style/table.css")
(defvar +dialog.css+ "/style/dialog/dialog.css")
(defvar +crud.css+ "style/crud.css")
;; -------------------------------------------------------------------------
;; Picasa Variables
;; -------------------------------------------------------------------------
(defvar +picasa-user-format-string+
"http://picasaweb.google.com/data/feed/api/user/~A")
(defparameter +picasa-album-format-string+
"http://picasaweb.google.com/data/feed/api/user/~A/albumid/~A?imgmax=640")
;;--------------------------------------------------------------------------
;; Mail Service Variables
;;--------------------------------------------------------------------------
(defvar +x-mailer+ "[Core-serveR] (http://labs.core.gen.tr)")
(defvar +x-http-client+ +x-mailer+) | 6,965 | Common Lisp | .lisp | 134 | 50.313433 | 86 | 0.534911 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 0d64ee843800b7ac300e7d725445b15b470b04b16974be51f6b6facb73e217da | 8,216 | [
-1
] |
8,217 | peer.lisp | evrim_core-server/src/peer.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :tr.gen.core.server)
;;+----------------------------------------------------------------------------
;;| Peer Base Classes
;;+----------------------------------------------------------------------------
;;
;; This file contains Peer Base Class.
;;
(defclass peer (unit)
((server :accessor peer.server :initarg :server :initform nil
:documentation "The server that this peer belongs to"))
(:documentation "Peer Base Class - Peers are worker units of
servers. The server when started creates N peers to handle incoming
requests. These requests can come from very different sources like
sockets, unix pipes etc."))
(defclass stream-peer (peer local-unit)
()
(:default-initargs :name "Stream Peer Handling Unit")
(:documentation "Stream Peer Class - This is the base class for
core-stream handling peer"))
;; FIXme: Do we have a protocol for stream-peer having below method? -evrim
;; (defmethod/unit handle-stream :async-no-return ((self stream-peer) stream address)
;; (format t "1.Peer address:~A~%" address)
;; (let ((acc (make-accumulator :byte)))
;; (iterate (for str = (read-stream stream))
;; (when str (push-atom str acc))
;; (until (null str))
;; (finally
;; (close-stream stream)
;; (format t "GEE:~A~%" (octets-to-string acc :utf-8)))))
;; (sb-int::flush-standard-output-streams)) | 2,110 | Common Lisp | .lisp | 42 | 48.52381 | 85 | 0.668771 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | dc094e65445a8e513b6d56eef0e6cb6ab2e78897aaab74475eb195cfe2f0af48 | 8,217 | [
-1
] |
8,218 | application.lisp | evrim_core-server/src/application.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :core-server)
;;-----------------------------------------------------------------------------
;; Application Classes
;;-----------------------------------------------------------------------------
(defclass application ()
((server :accessor application.server :initform nil
:documentation "On which server this application is running, setf'ed after (register)")
(debug :accessor application.debug :initarg :debug :initform t
:documentation "Debugging flag for this application"))
(:documentation "Base Application Class"))
| 1,292 | Common Lisp | .lisp | 22 | 56.818182 | 91 | 0.674051 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 9083a5a01c43ac90b0e4c21d533cf94c72ee9a5ff264f7c0735d7d78e5bf43cc | 8,218 | [
-1
] |
8,219 | core-server.lisp | evrim_core-server/src/core-server.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;+-------------------------------------------------------------------------
;;| [Core-serveR] Project
;;| http://labs.core.gen.tr
;;|
;;| Author: Evrim Ulu <[email protected]>
;;| Co-Author: Aycan Irican <[email protected]>
;;|
;;| Project launch date: Dec 2006
;;+-------------------------------------------------------------------------
(in-package :cl-user)
(defpackage :tr.gen.core.install)
(defpackage :tr.gen.core.ffi
(:nicknames :core-ffi)
(:use :cl :cffi)
(:export
#:gethostbyname
;;; #:epollin
;;; #:epollout
;;; #:epollerr
;;; #:make-epoll-device
;;; #:wait
;;; #:epoll-event.events
;;; #:epoll-event.fd
;; socket
#:%recv
#:%send
#:%close
;; libev
#:ev-loop
#:ev-unloop
#:ev-default-loop
#:bzero
#:set-nonblock
#:ev-watcher
#:ev-io
#:size-of-ev-io
#:ev-io-init
#:ev-io-start
#:ev-io-stop
#:ev-read
#:evunloop-all
#:uuid-generate))
(defpackage :tr.gen.core.server
(:nicknames :core-server)
(:use :common-lisp :arnesi :cl-ppcre :sb-bsd-sockets :tr.gen.core.install
:bordeaux-threads :cffi :salza2)
(:shadowing-import-from #:swank #:send #:receive #:accept-connection)
(:shadowing-import-from #:arnesi #:name #:body #:self #:new)
(:shadowing-import-from #:salza2 :callback)
(:shadowing-import-from #:arnesi #:result)
;; (:import-from #:cl-prevalence #:get-directory)
(:import-from #:arnesi #:fdefinition/cc)
(:import-from #:sb-ext #:make-timer #:schedule-timer #:unschedule-timer #:timer)
(:import-from :sb-mop
compute-class-precedence-list
validate-superclass
standard-slot-definition
standard-direct-slot-definition
standard-effective-slot-definition
direct-slot-definition-class
effective-slot-definition-class
slot-definition-name
slot-definition-initform
slot-definition-initfunction
compute-effective-slot-definition
class-slots
slot-value-using-class
slot-boundp-using-class
slot-makunbound-using-class
slot-definition-allocation
slot-definition-initargs
class-finalized-p
finalize-inheritance
ensure-class-using-class
compute-slots)
(:import-from :sb-pcl
initialize-internal-slot-functions
COMPUTE-EFFECTIVE-SLOT-DEFINITION
compute-effective-slot-definition-initargs
slot-definition-allocation-class
class-slot-cells
plist-value
+slot-unbound+)
(:export
;; [Threads]
#:thread-mailbox
#:thread-send
#:thread-receive
#:cleanup-mailbox
#:thread-spawn
#:thread-kill
;; [Streams]
#:core-stream
#:read-stream
#:peek-stream
#:checkpoint-stream
#:commit-stream
#:rewind-stream
#:write-stream
#:close-stream
#:core-streamp
#:return-stream
#:checkpoint-stream/cc
#:rewind-stream/cc
#:commit-stream/cc
;; [Standard Output Wrapper]
#:*core-output*
;; [Stream Types]
#:core-vector-io-stream
#:core-string-io-stream
#:core-fd-io-stream
#:core-file-io-stream
#:pipe-stream
#:core-transformer-stream
#:core-cps-stream
#:core-cps-string-io-stream
#:core-cps-fd-io-stream
#:core-cps-file-io-stream
#:make-transformer-stream
#:make-core-stream
#:make-core-file-input-stream
#:make-core-file-io-stream
#:make-core-file-output-stream
;; [Special Transformers 4 Javascript]
#:make-indented-stream
#:make-compressed-stream
#:increase-indent
#:decrease-indent
#:make-cps-stream
;; [Stream Helpers]
#:with-core-stream
#:with-core-stream/cc
;; [Class+]
#:find-class+
#:class+.find
#:class+
#:class+.name
#:class+.direct-superclasses
#:class+.direct-subclasses
#:class+.superclasses
#:class+.subclasses
#:class+.slots
#:class+.rest
#:class+.default-initargs
#:class+.slot-search
#:class+.local-slots
#:class+.remote-slots
#:class+.methods
#:class+.local-methods
#:class+.remote-methods
#:class+.search
#:defclass+
#:class+.register
#:class+.register-remote-method
#:class+.register-local-method
#:class+.ctor
#:local
#:both
#:remote
#:primitive
#:lift
#:defmethod/lift
;; [Sockets]
#:resolve-hostname
#:make-server
#:close-server
#:accept
#:connect
;; [Units]
#:unit
#:standard-unit
#:local-unit
#:me-p
#:defmethod/unit
#:run
;; [XML Markup]
#:xml
#:xml+
#:xml.tag
#:xml.attribute
#:xml.attributes
#:xml.children
#:xml.equal
#:xml-search
#:filter-xml-nodes
#:make-xml-type-matcher
#:generic-xml
;; [XML Stream]
#:make-xml-stream
#:xml-stream
;; [HTML Stream]
#:make-html-stream
#:parse-html
#:make-safe-html-stream
#:parse-safe-html
#:html-stream
#:safe-html-stream
#:href
;; [Dom Markup]
#:dom2string
#:get-elements-by-tag-name
;; [Html markup]
#:html-element
#:empty-html-element
#:defhtml-tag
#:defhtml-empty-tag
#:html?
#:html!
#:with-html-output
;; [CSS markup]
#:css-element
#:css.selector
#:css.attributes
#:css.children
#:css
#:css?
#:css!
;; [RSS markup]
#:rss-element
#:defrss-tag
#:rss?
#:rss!
;; [Javascript]
#:js
#:js*
#:symbol->js
#:with-js
#:rebinding-js
#:rebinding-js/cc
#:jambda
#:defrender/js
#:defun/javascript
#:+indent-javascript+
#:defjsmacro
#:defmacro/js
#:defsetf/js
#:defrender/js
#:true
#:false
#:undefined
#:while
#:regex
#:--
#:create
#:with
#:doeach
#:try
#:default
#:typeof
#:new
#:instanceof
#:with-field
#:by-id
#:make-component
#:delete-slot
#:delete-slots
#:_
#:bookmarklet-script
#:lift1
#:lift0
#:lifte
#:make-service
#:event
#:method
#:callable-component
#:call-component
#:replace-component
#:upgrade-component
#:answer-component
#:continue-component
#:continue/js
#:core-library!
#:write-core-library-to-file
#:funcall-cc
#:funcall2-cc
#:singleton-component-mixin
#:remote-reference
#:make-web-error
;; [RFC 2109]
#:cookie
#:cookie.name
#:cookie.value
#:cookie.version
#:cookie.comment
#:cookie.domain
#:cookie.max-age
#:cookie.path
#:cookie.secure
#:make-cookie
#:cookiep
#:cookie!
#:rfc2109-cookie-header?
#:rfc2109-cookie-value?
#:rfc2109-quoted-value?
#:cookie?
;; [RFC 2045]
#:quoted-printable?
#:quoted-printable!
#:base64?
#:base64!
;;;; header symbol
#:quoted-printable
;; [RFC 2046]
;;;; classes
#:mime
#:top-level-media
#:composite-level-media
;;;; accessors
#:mime.headers
#:mime.data
#:mime.children
;;;; helpers methods
#:mime.header
#:mime.filename
#:mime.name
#:mime.content-type
#:mime.serialize
;;;; utilities
#:mimes?
#:make-top-level-media
#:make-composite-level-media
#:mime-search
#:mime.header
;;;; header symbols
#:content-type
;; [RFC 2388]
#:rfc2388-mimes?
;; [RFC 2396]
#:uri
#:uri.scheme
#:uri.username
#:uri.password
#:uri.server
#:uri.port
#:uri.paths
#:uri.queries
#:uri.fragments
#:uri.query
#:uri.add-query
#:urip
#:make-uri
#:uri?
#:query!
#:uri!
#:uri->string
;; [RFC 822]
#:mailbox?
#:comment?
#:comment!
;; [RFC 2616]
;; Classes
#:http-request
#:http-response
;; Accessors
#:http-message.version
#:http-message.general-headers
#:http-message.unknown-headers
#:http-message.entities
#:http-request.method
#:http-request.uri
#:http-request.headers
#:http-request.referrer
#:http-request.entity-headers
#:http-request.stream
#:http-request.header
#:http-request.cookies
#:http-request.cookie
#:http-response.response-headers
#:http-response.status-code
#:http-response.entity-headers
#:http-response.stream
#:http-response.add-cookie
#:http-response.add-entity-header
#:http-response.add-response-header
#:http-response.set-content-type
#:http-response.get-entity-header
#:http-response.get-response-header
#:http-response.entities
;;; helpers
#:escape-parenscript
;; Http Request
#:http-accept?
#:http-accept-charset?
#:http-accept-encoding?
#:http-accept-language?
#:http-authorization?
#:http-request-headers?
#:http-expect?
#:http-from?
#:http-host?
#:http-if-match?
#:http-if-modified-since?
#:http-if-none-match?
#:http-if-range?
#:http-if-unmodified-since?
#:http-max-forwards?
#:http-proxy-authorization?
#:http-range?
#:http-referer?
#:http-te?
#:http-user-agent?
#:http-response!
;; HTTP Response
#:http-accept-ranges!
#:http-age!
#:http-etag!
#:http-location!
#:http-proxy-authenticate!
#:http-retry-after!
#:http-server!
#:http-vary!
#:http-www-authenticate!
;; HTTP General Headers
#:http-cache-control?
#:http-cache-control!
#:http-connection?
#:http-connection!
#:http-date?
#:http-date!
#:http-pragma?
#:http-pragma!
#:http-trailer?
#:http-trailer!
#:http-transfer-encoding?
#:http-transfer-encoding!
#:http-upgrade?
#:http-upgrade!
#:http-via?
#:http-via!
#:http-warning?
#:http-warning!
;; HTTP Request methods
#:OPTIONS
#:GET
#:HEAD
#:POST
#:PUT
#:DELETE
#:TRACE
#:CONNECT
;; Cache Request Directives
#:NO-CACHE
#:NO-STORE
#:MAX-AGE
#:MAX-STALE
#:MIN-FRESH
#:NO-TRANSFORM
#:ONLY-IF-CACHED
;; Cache Response Directives
#:PUBLIC
#:PRIVATE
#:NO-CACHE
#:NO-STORE
#:NO-TRANSFORM
#:MUST-REVALIDATE
#:PROXY-REVALIDATE
#:MAX-AGE
#:S-MAXAGE
;; General Headers
#:CACHE-CONTROL
#:CONNECTION
#:DATE
#:PRAGMA
#:TRAILER
#:TRANSFER-ENCODING
#:UPGRADE
#:VIA
#:WARNING
;; Request Headers
#:ACCEPT
#:ACCEPT-CHARSET
#:ACCEPT-ENCODING
#:ACCEPT-LANGUAGE
#:AUTHORIZATION
#:EXPECT
#:100-CONTINUE
#:FROM
#:HOST
#:IF-MATCH
#:IF-MODIFIED-SINCE
#:IF-RANGE
#:IF-UNMODIFIED-SINCE
#:MAX-FORWARDS
#:PROXY-AUTHORIZATION
#:RANGE
#:REFERER
#:TE
#:USER-AGENT
;; Response Headers
#:ACCEPT-RANGES
#:AGE
#:ETAG
#:LOCATION
#:PROXY-AUTHENTICATE
#:RETRY-AFTER
#:SERVER
#:VARY
#:WWW-AUTHENTICATE
;; Entity Headers
#:ALLOW
#:CONTENT-ENCODING
#:CONTENT-LANGUAGE
#:CONTENT-LENGTH
#:CONTENT-LOCATION
#:CONTENT-MD5
#:CONTENT-RANGE
#:CONTENT-TYPE
#:EXPIRES
#:LAST-MODIFIED
;; Browser Symbols
#:BROWSER
#:VERSION
#:OPERA
#:MOZ-VER
#:OS
#:REVISION
#:IE
#:SEAMONKEY
#:LANG
;;
;; [Protocol]
;; Classes
#:application
#:web-application
#:server
#:web-server
#:persistent-server
#:persistent-application
;; Accessors
#:application.server
#:application.debug
#:auto-start
#:debug
#:server.name
#:server.mutex
#:server.debug
#:web-application.fqdn
#:web-application.admin-email
#:web-application.serve-url
#:web-application.base-url
#:web-application.password-of
#:web-application.find-user
#:web-application.realm
;; API
#:start
#:stop
#:status
#:stop-start
#:register
#:unregister
#:with-server-mutex
;; [Apache]
;; Classes
#:apache-server
#:apache-web-application
#:vhost-template-pathname
#:skel-pathname
#:default-entry-point
;; Accessors
#:apache-web-application.vhost-template-pathname
#:apache-web-application.redirector-pathname
#:apache-web-application.default-entry-point
#:apache-web-application.skel-pathname
#:apache-web-application.config-pathname
#:apache-web-application.docroot-pathname
#:apache-server.apachectl-pathname
#:apache-server.htpasswd-pathname
#:apache-server.vhosts.d-pathname
#:apache-server.htdocs-pathname
;; API
#:graceful
#:create-docroot
#:create-vhost-config
#:create-redirector
#:validate-configuration
#:config-pathname
#:apache-server.refresh
#:apache-server.destroy
;; [Logger]
#:logger-server
#:log-me
#:log!
#:logger-application
#:logger-application.log-pathname
#:logger-application.log-stream
#:log-patname
#:log-stream
;; [Database]
;; Classes
#:database-server
#:database
#:database.directory
#:database.transaction-log-pathname
#:database.snapshot-pathname
;; [Socket Server]
#:socket-server
;; Interface
#:serialization-cache
#:xml-serialize
#:xml-deserialize
#:dynamic-class+
#:transaction
#:with-transaction
#:deftransaction
#:execute
#:snapshot
#:purge
#:database.root
#:database.get
#:database.serialize
#:database.deserialize
#:database.clone
#:log-transaction
#:database.directory
#:database-directory
;; Object Database
#:object-with-id
#:get-database-id
#:database-id
#:find-all-objects
#:find-objects-with-slot
#:find-object-with-slot
#:find-object-with-id
#:update-object
#:add-object
#:delete-object
#:change-class-of
#:next-id
#:standard-model-class
;; Accessors
#:database-server.model-class
#:standard-model-class.creation-date
;; API
#:database-server.model-class
#:create-guard-with-mutex
#:model
#:make-database
#:update-slots
;; db utils
;;; #:make-tx
;;; #:update-slots
#:defcrud
#:defcrud/lift
#:redefmethod
#:copy-slots
;; [Nameserver]
;; Classes
#:name-server
#:ns-model
#:ns-mx
#:ns-alias
#:ns-ns
#:ns-host
;; Accessors
#:name-server.ns-script-pathname
#:name-server.ns-db-pathname
#:name-server.ns-root-pathname
#:name-server.ns-compiler-pathname
#:name-server.ns-db
#:ns-model.domains
#:ns-record.source
#:ns-record.target
;; API
#:with-nameserver-refresh
#:name-server.refresh
#:host-part
#:domain-part
#:find-host
#:add-mx
#:add-ns
#:add-host
#:add-alias
#:find-domain-records
;; [Postfix]
;; Classes
#:mail-server
#:postfix-server
#:POSTFIX-SCRIPT-PATHNAME
;; API
#:add-email
#:del-email
;; [Ticket]
;; Classes
#:ticket-model
#:ticket-server
;; API
#:make-ticket-server
#:generate-tickets
#:find-ticket
#:add-ticket
#:ticket-model.tickets
#:ticket-server.db
;; [Core]
;; Classes
#:core-server
#:core-web-server
#:*core-server*
#:*core-web-server*
;; [Whois]
;; API
#:whois
;; Helpers
#:reduce0
#:reduce-cc
#:reduce0-cc
#:mapcar-cc
#:reverse-cc
#:filter
#:filter-cc
#:find-cc
#:flip-cc
#:mapcar2-cc
#:load-css
#:load-javascript
#:uniq
#:prepend
#:make-keyword
#:with-current-directory
#:make-project-path
#:with-current-directory
#:time->string
#:get-unix-time
#:concat
#+ssl #:hmac
#:+day-names+
#:+month-names+
#:take
#:any
#:make-type-matcher
#:drop
#:flatten
#:flatten1
;; [Applications]
#:postfix-application
;; [Serializable Application]
#:serializable-web-application
;; [Darcs Web Application]
;; Classes
#:make-darcs-application
#:darcs-application
#:src/model
#:src/packages
#:src/interfaces
#:src/security
#:src/tx
#:src/ui/main
#:src/application
#:darcs-application.sources
#:serialize-source
#:serialize-asd
#:serialize
#:share
#:evaluate
#:record
#:put
#:push-all
;; [HTTP Server]
#:find-application
#:register
#:unregister
#:server.applications
#:server.root-application
;; [HTTP Application & Web Framework]
;; Constants
#:+continuation-query-name+
#:+session-query-name+
#:+context+
;; Session
#:http-session
#:session.id
#:session.continuations
#:session.timestamp
#:session.data
#:make-new-session
#:find-session-id
#:find-continuation
#:update-session
#:query-session
;; Context
#:http-context
#:context.request
#:context.response
#:context.session
#:context.application
#:context.remove-action
#:context.remove-current-action
;; Metaclass
#:http-application+
#:http-application+.handlers
#:add-handler
#:remove-handler
;; Class
#:http-application
#:root-web-application-mixin
#:http-application.sessions
#:defapplication
#:find-session
#:map-session
#:render-404
#:render-file
#:dispatch
#:reset-sessions
;; Macros
#:with-query
#:with-context
#:defauth
#:basic
#:digest
#:defhandler
#:defhandler/static
#:defhandler/js
#:defurl
;; CPS Style Web Framework
#:send/suspend
#:send/forward
#:send/finish
#:send/redirect
#:action/hash
#:+action-hash-override+
#:function/hash
#:action/url
#:function/url
#:answer
#:answer/dispatch
#:answer/url
#:javascript/suspend
#:json/suspend
#:xml/suspend
#:css/suspend
#:with-cache
;; Test Utilties
#:with-test-context
#:kontinue
#:test-url
;; [HTTP Component Framework]
#:component
#:component.application
#:component.instance-id
#:component.serialize
#:component.deserialize
#:component.serialize-slot
#:component.javascript-reader
#:component.javascript-writer
#:component.remote-method-proxy
#:component.local-method-proxy
#:component+.remote-morphism
#:component+.local-morphism
#:component.remote-slots
#:component.local-slots
#:component.remote-methods
#:component.remote-ctor-arguments
#:defcomponent-ctor
#:defcomponent
#:defservice
#:defmethod/local
#:defmethod/remote
#:cached-component
#:component!
#:funkall
#:funkall/js
#:to-json
#:to-json/js
#:html-component
#:defhtml-component
#:defcomponent-accessors
#:component.*
#:service.*
#:mtor!
#:upgrade
#:shift
#:reset
#:suspend
#:make-service
#:make-component
#:deftable
#:instances
#:remove-instance
#:add-instance
#:handle-crud
#:handle-crud/js
#:on-select
#:defwebcrud
#:view-buttons
#:view-buttons/js
;; [Rest]
#:defrest
#:abstract-rest
#:rest.find
#:rest.list
#:rest.add
#:rest.update
#:rest.delete
#:defrest-client
;; [ Web Component Stacks ]
#:dojo
#:jquery
;; [ Json ]
#:json!
#:json?
#:json-serialize
#:json-deserialize
#:jobject
#:with-attributes
#:get-attribute
#:set-attribute
#:jobject.attributes
#:object->jobject
#:assoc->jobject
;; [ Tags ]
#:input
;; [ Form Components ]
#:validation-span-id
#:valid-class
#:invalid-class
#:valid
#:default-value
#:min-length
;; [[validating input]]
#:get-default-value/js
#:set-default-value/js
#:adjust-default-value/js
#:onfocus/js
#:onblur/js
[[Dialog Components]]
#:dialog
#:supply-dialog
#:make-dialog
#:login-dialog
#:yes-no-dialog
#:supply-yes-no-dialog
#:make-yes-no-dialog
#:registration-dialog
#:forgot-password-dialog
#:prompt-dialog
#:supply-prompt-dialog
#:make-prompt-dialog
#:big-dialog
;; #:template
#:template/js
#:dialog-buttons
#:dialog-buttons/js
#:get-message
#:buttons
#:get-buttons
#:set-buttons
#:show-component
#:show-component/js
#:hide-component
#:hide-component/js
#:init
#:init/js
#:destroy
#:destroy/js
#:client-destroy
#:client-destroy/js
#:_destroy
#:funkall
;; [DOm Components]
#:css-class
#:tag
#:id
;; [Web Components]
#:ckeditor-component
#:supply-ckeditor
#:make-ckeditor
#:make-ckeditor/js
#:toaster-component
#:toast
#:login-component
#:feedback-component
#:hedee-component
#:make-hedee
#:hilighter
#:button-set
#:buttons
#:history-component
#:history-mixin
#:on-history-change
#:register-history-observer
#:unregister-history-observer
#:start-history-timeout
#:stop-history-timeout
#:sortable-list-component
#:get-input-value
#:get-instances
#:add-instance
#:delete-instance
#:update-instance
[Jquery]
#:supply-jquery
#:load-jquery
#:load-jquery/js
#:supply-jquery-ui
#:load-jquery-ui
#:load-jquery-ui/js
#:supply-jquery-lightbox
#:load-jquery-lightbox
#:load-jquery-lightbox/js
#:lightbox-config
#:supply-jquery-carousel
#:load-jquery-carousel
#:load-jquery-carousel/js
#:carousel-config
#:supply-jquery-nested-sortable
#:load-jquery-nested-sortable
#:load-jquery-nested-sortable/js
#:supply-jquery-newsticker
#:load-jquery-newsticker
#:load-jquery-newsticker/js
#:supply-jquery-slider
#:supply-jquery-text-effects
#:load-jquery-slider
#:load-jquery-slider/js
#:load-jquery-text-effects
#:load-jquery-text-effects/js
#:supply-jquery-tree
#:load-jquery-tree
#:load-jquery-tree/js
[Picasa]
#:supply-picasa
#:get-albums
#:get-photos
;; [Presentation]
;; #:defpresentation
;; [Helpers]
#:make-keyword
#:make-unique-random-string
;; [Search]
#:core-search
#:string-search
#:integer-search
;; [Mail-Sender]
#:mail-sender
#:mail-sender.from
#:mail-sender.server
#:mail-sender.port
#:sendmail
#:make-mail
;; [Filesystem]
#:filesystem
#:filesystem.label
#:filesystem.root
#:readfile
#:writefile
#:ls
;; [Parser]
#:string!
#:char!
#:fixnum!
#:quoted-printable!
#:make-accumulator
;; The server itself
*server*
;; Form component (which emails a filled form)
#:web-form-component
;; socialshare
#:socialshare-component
;; [ Core Commands ]
#:defcommand
#:command
#:command.output-stream
#:command.input-stream
#:command.verbose
#:command.verbose-stream
#:command.local-args
#:command.remote-args
#:shell
#:render-arguments
#:whereis
#:thumbnail
#:http
#:http.url
#:http.method
#:http.post-data
#:http.add-query
#:http.setup-uri
#:http.evaluate
;; [ Core Parser ]
#:defrule
#:defparser
#:defrender
;; [ DNS Application ]
#:dns-application
#:dns-application.ns
#:dns-application.mx
#:dns-application.alias
#:ns
#:mx
#:alias
#:deploy-ns
#:deploy-mx
#:deploy-alias
;; [ Web Application ]
#:fqdn
#:admin-email
#:project-name
#:project-pathname
#:htdocs-pathname
#:web-application.fqdn
#:web-application.admin-email
#:web-application.project-name
#:web-application.project-pathname
#:web-application.htdocs-pathname
;; [ Application ]
#:initargs
#:server
#:debug
#:application.initargs
#:application.debug
#:application.server
;; [ Web Variables ]
#:+jquery.js+
#:+jquery-ui.css+
#:+jquery-ui.js+
#:+jquery-lightbox.js+
#:+jquery-lightbox.css+
#:+jquery-lightbox-config+
#:+jquery-carousel.js+
#:+jquery-carousel.css+
#:+jquery-carousel-config+
#:+jquery-nested-sortable.js+
#:+jquery-newsticker.js+
#:+jquery-slider.js+
#:+jquery-slider.css+
#:+jquery-text-effects.js+
#:+jquery-tree.js+
#:+jquery-cookie.js+
#:+ckeditor.js+
#:+ckeditor-source.js+
#:+ckeditor.css+
#:+ckeditor-toolbar+
#:+ckeditor-simple-toolbar+
#:+ckeditor-config+
#:+core.css+
#:+tab.css+
#:+console.css+
#:+toaster.css+
#:+taskbar.css+
#:+sidebar.css+
#:+page-plugin.css+
#:+table.css+
#:+dialog.css+
#:+crud.css+
;; [Coretal]
;; #:abstract-controller
;; #:simple-controller
;; #:make-simple-controller
;; #:abstract-page
;; #:simple-page
;; #:make-simple-page
;; #:abstract-widget-map
;; #:simple-widget-map
;; #:make-simple-widget-map
;; #:abstract-widget
;; #:simple-widget
;; #:make-simple-widget
;; Widget Map
#:selector
#:widget
#:controller
;; Widget
#:widget-map
;; Plugin
#:plugin+
#:plugin
#:defplugin
#:show-tab
#:show-tab/js
[[Security]]
#:group.name
#:group.users
#:user.name
#:user.groups
#:user.group
#:user.has-group
#:secure-object
#:secure-object/authorized
#:secure-object/unauthorized
#:authorize
#:owner
#:group
#:other
#:anonymous
#:unauthorized
#:secure.owner
#:secure.group
#:secure.user
#:secure.application
#:secure.levels
#:secure.permissions
#:simple-group
#:make-simple-group
#:simple-group.add
#:simple-group.delete
#:simple-group.find
#:simple-group.list
#:simple-group.query
#:simple-group.update
#:simple-user
#:make-simple-user
#:simple-user.add
#:simple-user.delete
#:simple-user.find
#:simple-user.list
#:simple-user.query
#:simple-user.update
#:init-authentication
#:anonymous-user
#:make-anonymous-user
))
(defpackage :tr.gen.core.server.io
(:nicknames :io)
(:use :cl :core-server :cffi))
;; ----------------------------------------------------------------------------
;; Database Codomain
;; ----------------------------------------------------------------------------
(defpackage :<db
(:nicknames :tr.gen.core.tags.db)
(:export #:null #:true #:symbol #:character #:integer #:string
#:ratio #:complex #:float #:vector #:cons #:hash-table
#:hash-table-entry #:hash-table-key #:hash-table-value
#:slot #:struct #:class #:instance #:ref #:object-with-id
#:transaction #:pathname #:dynamic-class))
;; -------------------------------------------------------------------------
;; JSON Codomain
;; -------------------------------------------------------------------------
(defpackage :<json
(:nicknames :tr.gen.core.server.json :core-server.json)
(:export #:string #:number #:boolean #:array #:true #:false #:nil
#:object #:closure #:hash-table #:undefined #:symbol
#:instance #:json))
;; -------------------------------------------------------------------------
;; Web Framework Codomain
;; -------------------------------------------------------------------------
(defpackage :<core
(:nicknames :tr.gen.core.server.tags)
(:use :cl)
(:export #:input #:redirect #:table
#:validating-input #:default-value-input
#:domain-input #:email-input #:password-input
#:password-combo-input
#:required-value-input #:number-value-input
#:username-input #:tab #:crud #:date-time-input
#:auth #:core #:ckeditor #:lazy-ckeditor
#:select-input #:multiple-select-input
#:radio-group #:simple-clock #:table-with-crud
#:multiple-checkbox #:checkbox #:fqdn-input
#:in-place-edit
#:simple-page #:simple-page/unauthorized
#:simple-page/anonymous #:simple-page/registered
#:simple-widget-map #:simple-widget-map/anonymous
#:simple-controller #:controller/unauthorized
#:simple-controller/anonymous
#:simple-controller/authorized
#:login #:dialog #:prompt-dialog #:yes-no-dialog
#:login-dialog #:registration-dialog
#:forgot-password-dialog #:big-dialog
#:fullscreen-dialog
#:console #:toaster-task #:task #:menu-task #:taskbar
#:language-pack #:sidebar
#:portal-controller #:template #:template/anonymous #:template/owner
#:page #:page/anonymous #:page/owner))
;; -------------------------------------------------------------------------
;; Rest Codomain
;; -------------------------------------------------------------------------
(defpackage :<rest
(:nicknames :tr.gen.core.server.rest :core-server.rest)
(:export #:find #:list #:add #:update #:delete))
;; -------------------------------------------------------------------------
;; Coretal CoDomain
;; -------------------------------------------------------------------------
(defpackage :<coretal
(:nicknames :tr.gen.core.server.coretal :core-server.coretal)
(:export #:controller))
;; -------------------------------------------------------------------------
;; Plugin CoDomain
;; -------------------------------------------------------------------------
(defpackage :<plugin
(:nicknames :tr.gen.core.server.plugin :core-server.plugin)
(:use :core-server)
(:export #:page #:page.get #:page/anonymous #:page/registered #:page/owner))
;; -------------------------------------------------------------------------
;; Widget CoDomain
;; -------------------------------------------------------------------------
(defpackage :<widget
(:nicknames :tr.gen.core.server.widget :core-server.widget)
(:use :core-server)
(:export #:simple #:simple-content #:simple-menu #:tab))
;; -------------------------------------------------------------------------
;; HTML CoDomain
;; -------------------------------------------------------------------------
(defpackage :<
(:nicknames :tr.gen.core.server.html :<html :core-server.html)
(:use :core-server)
(:export #:a #:abbr #:acronym #:address #:area #:b #:base #:bdo #:big
#:blockquote #:body #:br #:button #:caption #:cite #:code #:col
#:colgroup #:dd #:del #:dfn #:div #:dl #:dt #:em #:fieldset #:form
#:frame #:frameset #:h1 #:h2 #:h3 #:h4 #:h5 #:h6 #:head #:hr
#:html #:i #:iframe #:img #:input #:ins #:kbd #:label #:legend
#:li #:link #:map #:meta #:noframes #:noscript #:object #:ol
#:optgroup #:option #:p #:param #:pre #:q #:samp #:script
#:select #:small #:span #:strike #:strong #:style #:sub #:sup
#:table #:tbody #:td #:textarea #:tfoot #:th #:thead
#:title #:tr #:tt #:u #:ul #:var #:embed #:foo #:bar))
;; -------------------------------------------------------------------------
;; XML Schema CoDomain
;; -------------------------------------------------------------------------
(defpackage :<xs
(:nicknames :tr.gen.core.server.xml-schema :core-server.xml-schema)
(:export #:schema #:element #:complex-type #:sequence #:any
#:any-attribute #:annotation #:documentation #:complex-content
#:extension #:unique #:selector #:field #:choice #:attribute
#:simple-type #:list #:union #:restriction #:enumeration
#:simple-content #:import :attribute-group #:pattern))
;; -------------------------------------------------------------------------
;; OpenID CoDomain (Depreciated)
;; -------------------------------------------------------------------------
(defpackage :<openid
(:nicknames :tr.gen.core.server.openid)
(:use :cl)
(:export #:funkall #:associate #:request-authentication
#:verify-authentication))
;; -------------------------------------------------------------------------
;; OAuth v1.0 CoDomain
;; -------------------------------------------------------------------------
(defpackage :<oauth1
(:nicknames :tr.gen.core.server.oauth1)
(:use :cl)
(:export #:funkall #:funkall.parameters #:funkall.signature-key
#:funkall.sign #:funkall.build-signature #:funkall.header
#:get-request-token
#:request-token #:request-token.token #:request-token.token-secret
#:request-token.callback-confirmed #:%make-request-token
#:authorize-url #:access-token #:%make-access-token
#:get-access-token #:secure-funkall))
;; -------------------------------------------------------------------------
;; OAuth v2.0 CoDomain
;; -------------------------------------------------------------------------
(defpackage :<oauth2
(:nicknames :tr.gen.core.server.oauth2)
(:use :cl)
(:export #:oauth-uri #:exception #:exception.code #:exception.type
#:exception.message #:funkall #:access-token #:access-token.timestamp
#:access-token.expires #:access-token.token
#:access-token.id-token #:access-token.token-type
#:%make-access-token
#:get-access-token #:authorized-funkall))
;; -------------------------------------------------------------------------
;; Facebook CoDomain
;; -------------------------------------------------------------------------
(defpackage :<fb
(:nicknames :tr.gen.core.server.facebook)
(:use :cl)
(:export #:oauth-uri #:get-access-token #:authorized-funkall #:me
#:friends #:home #:feed #:likes #:movies #:music #:books
#:notes #:permissions #:photos #:albums #:videos #:events
#:groups #:checkins #:videos-uploaded
#:fetch #:authenticate))
;; -------------------------------------------------------------------------
;; Google CoDomain
;; -------------------------------------------------------------------------
(defpackage :<google
(:nicknames :tr.gen.core.server.google)
(:use :cl)
(:export ;; OAuth 2.0
#:oauth-uri #:get-access-token #:userinfo
;; Open ID (Depreciated)
;; #:associate #:request-authentication
;; #:verify-authentication #:extract-authentication
))
;; -------------------------------------------------------------------------
;; Twitter CoDomain
;; -------------------------------------------------------------------------
(defpackage :<twitter
(:nicknames :tr.gen.core.server.twitter)
(:use :cl)
(:export #:funkall #:authorize-url #:get-request-token #:get-access-token
#:access-token #:%make-access-token #:get-user-lists
#:secure-get-user #:access-token.user-id #:access-token.screen-name))
;; -------------------------------------------------------------------------
;; Yahoo CoDomain
;; -------------------------------------------------------------------------
(defpackage :<yahoo
(:nicknames :tr.gen.core.server.yahoo)
(:use :cl)
(:export #:funkall #:authorize-url #:get-request-token #:request-token
#:%make-request-token #:get-access-token
#:access-token #:%make-access-token #:get-user-lists
#:secure-get-user #:access-token.user-id #:access-token.screen-name))
;; -------------------------------------------------------------------------
;; RSS CoDomain
;; -------------------------------------------------------------------------
(defpackage :<rss
(:nicknames :tr.gen.core.server.rss :core-server.rss)
(:use :core-server))
;; -------------------------------------------------------------------------
;; Atom CoDomain
;; -------------------------------------------------------------------------
(defpackage :<atom
(:nicknames :tr.gen.core.server.atom)
(:use :cl)
(:export #:feed #:author #:category #:contributor
#:generator #:icon #:id #:link #:logo #:rights
#:subtitle #:title #:updated #:name #:email #:entry
#:summary #:uri #:published #:content
#:rss #:channel #:description #:pub-date #:language
#:cloud #:image #:url #:item #:guid))
;; -------------------------------------------------------------------------
;; Google GPhoto CoDomain
;; -------------------------------------------------------------------------
(defpackage :<gphoto
(:nicknames :tr.gen.core.server.gphoto)
(:use :cl)
(:export #:albumid #:id #:max-photos-per-album #:nickname
#:quotacurrent #:quotalimit #:thumbnail #:user
#:access #:bytes-used #:location #:numphotos
#:numphotosremaining #:checksum #:comment-count
#:commenting-enabled #:name
#:height #:rotation #:size #:timestamp
#:videostatus #:width #:albumtitle #:albumdesc
#:album-type
#:snippet #:snippettype #:truncated #:photoid
#:weight #:allow-prints #:allow-downloads #:version
#:position #:client #:license #:image-version))
;; -------------------------------------------------------------------------
;; Media CoDomain
;; -------------------------------------------------------------------------
(defpackage :<media
(:nicknames :tr.gen.core.server.media)
(:use :cl)
(:export #:group #:content #:rating #:title #:description
#:keywords #:thumbnail #:category #:hash #:player
#:credit #:copyright #:text #:restriction #:community
#:comments #:comment #:embed #:responses #:response
#:back-links #:back-link #:status #:price
#:license #:sub-title #:peer-link #:location #:rights #:scenes
#:scene))
;; -------------------------------------------------------------------------
;; OpenSearch CoDomain
;; -------------------------------------------------------------------------
(defpackage :<open-search
(:nicknames :tr.gen.core.server.open-search)
(:use :cl)
(:export #:total-results :start-index :items-per-page))
;; -------------------------------------------------------------------------
;; WordPress CoDomain
;; -------------------------------------------------------------------------
(defpackage :<wp
(:nicknames :<wordpress :tr.gen.core.server.wordpress)
(:use :cl)
(:export #:wxr_version #:base_site_url #:base_blog_url #:category
#:category_nicename #:tag #:tag_slug #:tag_name #:term
#:term_taxonomy #:category_parent #:cat_name #:term_slug
#:term_parent #:term_name #:post_id #:post_date #:post_name
#:post_parent #:post_date_gmt #:post_type #:post_password
#:comment_status #:ping_status #:is_sticky #:status #:menu_order
#:postmeta #:meta_key #:meta_value
#:comment #:comment_id #:comment_author #:comment_author_email
#:comment_author_url #:comment_author_-I-P #:comment_date
#:comment_date_gmt #:comment_content #:comment_approved
#:comment_user_id #:comment_type #:comment_parent
#:attachment_url #:category_description #:term_id
#:author #:author_id #:author_email #:author_display_name
#:author_first_name #:author_last_name #:author_login))
;; -------------------------------------------------------------------------
;; Content CoDomain
;; -------------------------------------------------------------------------
(defpackage :<content
(:nicknames :tr.gen.core.server.content)
(:use :cl)
(:export #:encoded))
;; -------------------------------------------------------------------------
;; DC CoDomain
;; -------------------------------------------------------------------------
(defpackage :<dc
(:nicknames :tr.gen.core.server.dc)
(:use :cl)
(:export #:creator))
;; -------------------------------------------------------------------------
;; Excerpt CoDomain
;; -------------------------------------------------------------------------
(defpackage :<excerpt
(:nicknames :tr.gen.core.server.excerpt)
(:use :cl)
(:export #:encoded))
| 38,662 | Common Lisp | .lisp | 1,497 | 21.948564 | 82 | 0.592464 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 6ff354627061d8029c88a40fc467fa9c3a835c606d2b1faf6b040b0777eaaa50 | 8,219 | [
-1
] |
8,220 | cps.lisp | evrim_core-server/src/lisp/cps.lisp | (in-package :core-server)
(fmakunbound 'expand-cps)
(defgeneric expand-cps (form expand k env)
(:documentation "Expanders for cps transformation"))
(defmacro defcps-expander (class (&rest slots) &body body)
`(eval-when (:load-toplevel :compile-toplevel :execute)
(defmethod expand-cps ((form ,class) expand k env)
(declare (ignorable expand))
;; (format t "Inside ~A~%" ',class)
(with-slots ,slots form
,@body))))
(defparameter +k+
(lambda (&rest values)
(throw 'done (apply #'values values))))
(defcps-expander form (source)
;; (unwalk-form form)
source
)
(defcps-expander null ()
;; (error "Expand-cps got nil")
nil)
(defcps-expander lambda-function-form (arguments declares body)
`(lambda (,@(unwalk-lambda-list arguments))
(declare ,@(unwalk-forms declares))
,@(call-next-method)))
(defcps-expander implicit-progn-mixin (body)
;; optimize a little bit, remove constants and var refs from progn,
;; they are not needed for next evaluation
(let ((body (reverse
(cons (car (reverse body))
(filter (lambda (form)
(not
(or (typep form 'constant-form)
(typep form 'variable-reference))))
(cdr (reverse body)))))))
(reduce (lambda (acc form)
(cons (with-unique-names (values)
`(write-stream +stream+ (lambda (&rest ,values)
(declare (ignore ,values))
,(funcall expand form expand k env))))
acc))
(cdr body) :initial-value (list (funcall expand (car body) expand k env)))))
(defcps-expander progn-form (body)
(if (= 1 (length body))
(car (call-next-method))
`(progn ,@(call-next-method))))
(defcps-expander application-form (operator arguments)
(cond
((eq operator 'call/cc1)
(with-unique-names (value stack checkpoints)
`(let* ((,stack (slot-value +stream+ '%stack))
(,checkpoints (slot-value +stream+ '%checkpoints)))
(funcall ,(funcall expand (car arguments) expand nil nil)
(lambda (,value)
(if (not (typep +stream+ 'core-cps-stream))
(error "Please call inside call/cc"))
(setf (slot-value +stream+ '%stack) ,stack
(slot-value +stream+ '%checkpoints) ,checkpoints)
,value)))))
(t
(flet ((constant-p (form)
(or (typep form 'constant-form)
(typep form 'variable-reference))))
(let* ((arguments (mapcar (lambda (arg)
(if (constant-p arg)
(cons arg (unwalk-form arg))
(cons arg (gensym))))
arguments))
(lazy-arguments (reverse (filter (compose #'not #'constant-p #'car) arguments))))
(reduce (lambda (k arg)
(with-unique-names (values)
`(progn
(write-stream +stream+ (lambda (,(cdr arg) &rest ,values)
(declare (ignore ,values))
,k))
,(funcall expand (car arg) expand nil nil))))
lazy-arguments
:initial-value `(,(if (gethash operator +cps-functions+)
(intern (format nil "~A/CC" operator))
operator)
,@(mapcar (lambda (arg) (cdr arg)) arguments))))))))
(defcps-expander multiple-value-call-form (func arguments)
`(progn
(write-stream +stream+ ,(funcall expand func expand nil nil))
,(funcall expand (car arguments) expand nil nil)))
(defcps-expander let-form (binds declares body)
(if (> (length binds) 0)
(funcall expand
(make-instance
'application-form
:operator 'funcall
:arguments (cons (make-instance 'lambda-function-form
:arguments (walk-lambda-list (mapcar #'car binds)
(parent form) nil)
:declares declares
:body body)
(mapcar #'cdr binds))
:parent (parent form))
expand k env)
`(progn ,@(call-next-method))))
(defcps-expander let*-form (binds body declares)
(let ((binds (reverse binds)))
(if (> (length binds) 0)
(funcall expand
(reduce (lambda (k bind)
(make-instance 'application-form
:operator 'funcall
:arguments
(cons (make-instance 'lambda-function-form
:arguments (walk-lambda-list (list (car bind)) (parent form) nil)
:body (list k))
(list (cdr bind)))))
(cdr binds)
:initial-value
(make-instance 'application-form
:operator 'funcall
:arguments
(cons (make-instance 'lambda-function-form
:arguments (walk-lambda-list (list (caar binds))
(parent form) nil)
:declares declares
:body body)
(list (cdar binds)))))
expand k env)
`(progn ,@(call-next-method)))))
(defcps-expander block-form (name body)
(with-unique-names (values)
`(progn
(checkpoint-stream2 +stream+ ',name)
(write-stream +stream+ (lambda (&rest ,values)
(rewind-stream2 +stream+ ',name)
(apply #'values ,values)))
,@(call-next-method form expand nil env))))
(defcps-expander return-from-form (name target-block result)
`(progn
(rewind-stream2 +stream+ ',name)
,(funcall expand result expand nil env)))
(defcps-expander if-form (consequent then else)
(with-unique-names (value values)
`(progn
(write-stream +stream+ (lambda (,value &rest ,values)
(declare (ignore ,values))
(if ,value
,(funcall expand then expand nil env)
,(if else
(funcall expand else expand nil env)))))
,(funcall expand consequent expand nil env))))
(defcps-expander the-form (type-form value)
(if (or (typep value 'constant-form)
(typep value 'variable-reference))
(call-next-method)
(let ((sym (gensym)))
(funcall expand
(walk-form
`(let ((,sym ,(unwalk-form value)))
(declare (,type-form ,sym))
,sym)
(parent form))
expand nil nil))))
(defcps-expander tagbody-form (body tags)
`(labels ,(mapcar (lambda (tag next-tag)
(let ((body (walk-form
(if next-tag
`(progn
,@(unwalk-forms (cdr tag))
(,(car next-tag)))
`(progn ,@(unwalk-forms (cdr tag))))
(parent form))))
`(,(car tag) ()
(checkpoint-stream2 +stream+ ',(car tag))
,(funcall expand body expand (car tag) nil))))
tags (append (cdr tags) (list nil)))
,@(mapcar (rcurry expand expand nil nil)
(let ((collect t))
(nreverse
(reduce0 (lambda (acc form)
(cond
((and collect (typep form 'go-tag-form))
(setq collect nil)
acc)
((and collect (typep form 'go-form))
(setq collect nil)
(cons form acc))
((not (null collect))
(cons form acc))
(t
acc)))
body))))))
(defcps-expander go-form (name target-progn enclosing-tagbody)
(if k
`(progn
(rewind-stream2 +stream+ ',k)
(,name))
`(,name)))
(defcps-expander go-tag-form (name)
(call-next-method))
(defcps-expander setq-form (var value)
(if (or (typep value 'constant-form)
(typep value 'variable-reference))
`(setq ,(unwalk-form var) ,(unwalk-form value))
(with-unique-names (sym other-values)
`(progn
(write-stream +stream+
(lambda (,sym &rest ,other-values)
(declare (ignore ,other-values))
(setq ,(unwalk-form var) ,sym)))
,(funcall expand value expand nil nil)))))
(defmacro with-call/cc2 (&body body)
`(run
(make-instance 'core-cps-stream
:stack (list ,(expand-cps (walk-form `(lambda (&rest values)
(declare (ignore values))
,@body)) #'expand-cps '#'identity nil)))))
(defmacro let/cc1 (k &body body)
`(call/cc1 (lambda (,k) ,@body)))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defvar +cps-functions+ (make-hash-table))
(defmacro defun/cc1 (name args &body body)
(setf (gethash name +cps-functions+) t)
`(progn
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (gethash ',name +cps-functions+) t))
(defun ,name ,args
,(expand-cps (walk-form `(block ,name ,@body)) #'expand-cps nil nil))))
(defmacro defun/cc2 (name args &body body)
`(progn
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (gethash ',name +cps-functions+) t))
;; (warn "Compiling CC Function ~A" ',name)
(defun ,name ,args
,@body)
(defun ,(intern (format nil "~A/CC" name)) ,args
,(expand-cps (walk-form `(block ,name ,@body)) #'expand-cps nil nil))))
(defmacro defmethod/cc1 (name args &body body)
(if (keywordp args)
`(defmethod ,name ,args ,(pop body)
,(expand-cps (walk-form `(block ,name ,@body)) #'expand-cps nil nil))
`(defmethod ,name ,args
,(expand-cps (walk-form `(block ,name ,@body)) #'expand-cps nil nil))))
(defmacro defmethod/cc2 (name args &body body)
`(progn
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (gethash ',name +cps-functions+) t))
(defmethod ,name ,args ,@body)
(defmethod ,(intern (format nil "~A/CC" name)) ,args
,(expand-cps (walk-form `(block ,name ,@body)) #'expand-cps nil nil)))))
(setf (gethash 'reduce +cps-functions+) t)
(defun/cc1 reduce/cc (lambda list &key initial-value)
(if (and list (listp list))
(reduce lambda (cdr list) :initial-value (funcall lambda initial-value (car list)))
initial-value))
(setf (gethash 'mapcar +cps-functions+) t)
(defun/cc1 mapcar/cc (lambda list)
(nreverse
(reduce (lambda (acc atom) (cons (funcall lambda atom) acc)) list)))
;; (defparser abc1 ()
;; (:return (values 1 2 3)))
;; (defparser abc2 (a b c)
;; (:abc1 a b c)
;; (:return (list a b c)))
;; (defparser test-parser2 ((abc "ebeN"))
;; (:sci abc)
;; (:return t))
;; (defparser test-parser1 (c (acc (make-accumulator)))
;; (:zom (:type visible-char? c)
;; (:collect c acc))
;; (:return (values acc 'test-parser1)))
;; (defparser test-parser2 (a b)
;; #\% (:test-parser1 a b)
;; (:return (list a b)))
;; (defun/cc2 test1 ()
;; (let ((a nil))
;; (push 'gee a)
;; (push 'zee a)
;; a))
;; (defun/cc2 abc ()
;; (values 1 2 3))
;; (defun/cc2 abc (a b c)
;; (list a b c))
;; (defmethod/cc2 abc123 ((self core-cps-stream) a)
;; (list self a))
;; (defun/cc2 test-tagbody (a b c)
;; (let ((count 0))
;; (tagbody
;; (setq a 'ae)
;; (go label-2)
;; label-1
;; (setq b 'be)
;; (if (> count 100000)
;; (go label-4)
;; (progn
;; ;; (describe count)
;; (setq count (+ 1 count))
;; (go label-2)))
;; label-2
;; (setq c 'ce)
;; (go label-1)
;; label-4
;; (list a b c)))
;; (list a b c))
;; (eval-when (:compile-toplevel :load-toplevel :execute)
;; (defmacro defparser/cc (name args &body body)
;; (with-unique-names (stream)
;; (flet ((rule-args ()
;; (if args
;; (list* stream '&aux args)
;; (list stream))))
;; `(defun/cc2 ,name ,(rule-args)
;; (block rule-block
;; (let ((cp (current-checkpoint ,stream)))
;; ,(expand-parser (walk-grammar `(:checkpoint ,@body))
;; #'expand-parser stream)
;; nil)))))))
;; (defmacro defparser2 (name args &body body)
;; (with-unique-names (stream)
;; (flet ((rule-args ()
;; (if args
;; (list* stream '&aux args)
;; (list stream))))
;; `(defun/cc2 ,name ,(rule-args)
;; ,(unwalk-form
;; (walk-form
;; `(block rule-block
;; (let ((cp (current-checkpoint ,stream)))
;; ,(expand-parser (walk-grammar `(:checkpoint ,@body))
;; #'expand-parser stream)
;; nil))))))))
;; (defparser/cc test-parse1 (c (acc (make-accumulator)))
;; (:zom (:type visible-char? c)
;; (:collect c acc))
;; (:return acc))
;; (defparser2 test-parse1 (c (acc (make-accumulator)))
;; (:zom (:type visible-char? c)
;; (:collect c acc))
;; (:return acc))
;; (with-kol/cc
;; (let ((a 1))
;; (block moo
;; (list a 2 3)
;; (return-from moo 'eben)
;; (list a a a))
;; ;; (block eben
;; ;; (list a 2 3)
;; ;; ;; (return-from eben
;; ;; ;; (list 'a
;; ;; ;; (block block-name
;; ;; ;; ;; (list 'a 2 3)
;; ;; ;; (return-from block-name (list 1 2 3))
;; ;; ;; (list 3 2 1))))
;; ;; )
;; ;; (list a 1)
;; )
;; )
;; (with-kol/cc
;; (let ((a (list 1 2)))
;; (list a (block moo
;; ;; (return-from moo 'eben)
;; (list 1 2 3)
;; ))))
;; (let* ((stack (expand-cps (walk-form `(lambda (value)
;; (declare (ignore value))
;; (list (list 3 2 1) (list 1 2 3))
;; (list (list 3 2 1) (list 1 2 3))
;; (list (list 3 2 1) (list 1 2 3))
;; (list (list 3 2 1) (list 1 2 3))
;; (list (list 3 2 1) (list 1 2 3))
;; (list (list 3 2 1) (list 1 2 3))
;; (list (list 3 2 1) (list 1 2 3))
;; (list 1 2 3))) #'expand-cps '#'identity nil))
;; (stack (eval stack))
;; (monad (make-instance 'core-cps-stream :stack (list stack))))
;; (describe stack)
;; (time
;; (loop for i from 0 upto 10000
;; do (run monad)
;; do (setf (slot-value monad '%stack) (list stack)))))
;; (defvar +cps+ nil)
;; (defparameter +g+
;; (lambda (value)
;; (write-stream +stream+
;; (lambda (value)
;; (write-stream +stream+
;; (lambda (value)
;; (list 'a 'b 'c)))
;; (list 3 2 1)))
;; (list 1 2 3)))
;; (let ((self (make-instance 'core-cps-stream
;; :stack (loop for i from 0 upto 10000 collect +g+))))
;; (time (run self)))
;; (lambda (value)
;; (write-stream +stream+
;; (lambda (value)
;; (list 1 2 3 value)))
;; (list 3 2 1))
;; (defcps-expander implicit-progn-mixin (body)
;; (cond
;; ((= 1 (length body))
;; (funcall expand (car body) expand k env))
;; (t
;; (funcall expand
;; (walk-form `(progn ,@(unwalk-forms (butlast body))))
;; expand
;; `(lambda (value)
;; ,(funcall expand (car (reverse body)) expand k env))
;; env))))
;; (defvar +cps-functions+ (make-hash-table))
;; (setf (gethash 'do-a +cps-functions+) t)
;; (setf (gethash 'do-b +cps-functions+) t)
;; (defcps-expander application-form (operator arguments)
;; (let ((k (if (symbolp k)
;; `(function ,k)
;; k)))
;; (cond
;; ((gethash operator +cps-functions+)
;; `(let ((+k+ ,k))
;; (,operator ,@(mapcar (rcurry expand expand k env) arguments))))
;; ((eq 'call/cc operator)
;; `(funcall ,(funcall expand (car arguments) expand k env) ,k))
;; (t
;; `(funcall ,k (,operator ,@(mapcar (rcurry expand expand k env) arguments)))))))
;; (defmacro with-kol/cc (&body body)
;; (expand-cps (walk-form `(progn ,@body)) #'expand-cps 'identity nil))
;; (defmacro defun/ccc (name args &body body)
;; (with-unique-names (k)
;; `(defun ,name (,@args ,k)
;; ,(expand-cps (walk-form `(progn ,@body)) #'expand-cps k nil))))
;; (defun/ccc do-a (a b c)
;; (list a b c))
;; (defmacro defun/cccc (name args &body body)
;; `(defun ,name ,args
;; ,(expand-cps (walk-form `(progn ,@body)) #'expand-cps '+k+ nil)))
;; (defun/cccc do-b (a b c)
;; (list a b c))
;; (with-kol/cc
;; ;; (do-a 1 2 3)
;; (do-b 3 2 1)
;; (do-b 1 2 3)
;; (let/cc k
;; (funcall k k))
;; (identity 5)
;; ;; (list 'a 'b 'd)
;; )
;; (progn
;; (do-a 1 2 3)
;; (do-b 3 2 1)
;; (list 'a 'b 'c))
;; (progn
;; (do-a 1 2 3
;; (lambda (value)
;; (do-b 3 2 1
;; (lambda (value)
;; (list 'a 'b 'c kont))))))
;; (progn
;; (do-a 1 2 3 kont)
;; (do-b 1 2 3 kont)
;; (list 'a 'b 'c kont))
;; (defmacro defun/ccc (name args &body body)
;; (with-gensym (k)
;; `(defun ,name (,k ,args)
;; ,)))
;; (defcps-expander application-form (operator arguments)
;; )
;; (with-kol/cc
;; (let/cc k
;; ))
;; (defclass core-cps-stream (core-stream)
;; ((%stack :initarg :stack :initform (error "Stack should not be nil"))))
;; (defmethod read-stream ((self core-cps-stream))
;; (pop (s-v '%stack)))
;; (defmethod write-stream ((self core-cps-stream) value)
;; (push value (s-v '%stack)))
;; (defmethod run ((self core-cps-stream))
;; (catch 'done
;; (do ((k (read-stream self) (read-stream self))
;; (value nil (funcall k value)))
;; ((null k) value))))
;; (defcps-expander form ()
;; (unwalk-form form))
;; (defmacro with-kol/cc (&body body)
;; `(run
;; (make-instance 'core-cps-stream
;; :stack (list ,(expand-cps (walk-form `(lambda (k) ,@body)) #'expand-cps)))))
;; (with-kol/cc (list 1 2 3))
;; (defmacro eskeyp (value)
;; `(throw 'done ,value))
;; (with-kol/cc
;; (eskeyp (list 3 2 1))
;; (list 1 2 3))
;; (defmacro with-kol/cc (&body body)
;; `(catch 'done
;; (let ((thunk ,(expand-cps (walk-form `(lambda () ,@body)) #'expand-cps)))
;; (loop (setq thunk (funcall thunk))))))
;; (with-kol/cc
;; (throw 'done 'moo))
;; (defcps-expander constant-form (value)
;; `(lambda ()
;; (funcall +k+ ,value)))
;; (defcps-expander variable-reference (name)
;; `(lambda ()
;; (funcall +k+ ,name)))
;; (with-kol/cc 1)
;; (defcps-expander let-form (binds declares body)
;; (let ((bind (gensym)))
;; `(lambda ()
;; (let ((+k+ (lambda (,bind)
;; (let ((,(caar binds) ,bind))
;; ,@(mapcar (rcurry expand expand) body)))))
;; (funcall +k+ ,(unwalk-form (cdar binds)))))))
;; (with-kol/cc
;; (let ((a 'a))
;; a))
;; (defmacro let/ccc (k &body body)
;; `(funcall (lambda (,k) ,@body) +k+))
;; (with-kol/cc
;; (let ((a 1))
;; (let/ccc k
;; (funcall k a))))
;; (eval-when (:compile-toplevel :load-toplevel :execute)
;; (defvar +cps-macros+ (make-hash-table))
;; (defvar +cps-functions+ (make-hash-table)))
;; (defmacro defcpsmacro (name args &body body)
;; `(setf (gethash ',name +cps-macro+)
;; (lambda (k ,@args)
;; ,@body)))
;; (defcpsmacro let/ccc (k1 &body body)
;; `(list ,k1 ,@body))
;; (defmethod expand-cps ((form t) expand env k)
;; form)
;; (defcps-expander form ()
;; form)
;; (defcps-expander constant-form (value)
;; (if k
;; `(funcall ,k ,value)
;; value))
;; (defcps-expander variable-reference (name)
;; (if k
;; `(funcall ,k ,name)
;; name))
;; (defun/ccc def (a)
;; (+ a 1))
;; (defun/ccc abc (a b)
;; (+ a b))
;; ;; heyoo
;; ;; (fact1 (- m a) (* m a))
;; ;; =>
;; ;; (-- m a (lambda (t13)
;; ;; (** m a (lambda (t14)
;; ;; (fact1 t13 t14 k)))))
;; (defcps-expander application-form (operator arguments)
;; ;;; (reduce (lambda (acc arg)
;; ;;; (funcall expand (car arg) expand env `(lambda (,(cdr arg)) (funcall ,acc ,(cdr arg)))))
;; ;;; (mapcar (lambda (arg)
;; ;;; (cons arg (gensym "ARG-")))
;; ;;; (reverse arguments))
;; ;;; :initial-value k)
;; ;;; ;; arguments)
;; ;;; ;; (let ((temp-args (mapcar (lambda (a) (gensym "ARG-")) (seq (length arguments)))))
;; ;;; ;; `((lambda (,@temp-args)
;; ;;; ;; (,operator ,@temp-args))
;; ;;; ;; ,@(mapcar (rcurry expand expand env k) arguments)))
;; ;;; ;; (if (null (cadr (multiple-value-list (gethash operator +cps-functions+))))
;; ;;; ;; `(,operator ,@(mapcar #'unwalk-form arguments))
;; (labels ((loop1 (x y z)
;; (if (null x)
;; (do ((F (reverse (cons k y))
;; (if (null (car z)) F
;; (funcall expand (car z) expand
;; env `(lambda (,(car y)) ,F))))
;; (y y (cdr y))
;; (z z (cdr z)))
;; ((null z) f))
;; (cond
;; ((or (null (car x)) (atom (car x)))
;; (loop1
;; (cdr x)
;; (cons (funcall expand (car x) expand env nil) Y)
;; (cons nil z)))
;; ((eq (caar x) 'quote)
;; (loop1 (cdr x) (cons (car x) y) (cons nil z)))
;; ((eq (caar x) 'lambda)
;; (loop1
;; (cdr x)
;; (cons (funcall expand (car x) expand env nil) y)
;; (cons nil z)))
;; (t
;; (loop1 (cdr x)
;; (cons (gensym "'T") Y)
;; (cons (car x) z)))))))
;; (format t "gee!~%")
;; (loop1 (mapcar (lambda (a) (if (typep a 'form) (unwalk-form a) a))
;; (cons operator arguments)) nil nil)))
;; ;;)
;; ;; (defcps-expander lambda-application-form (operator arguments)
;; ;; )
;; (defcps-expander lambda-function-form (arguments body declares)
;; (let ((arguments (mapcar #'unwalk-form arguments)))
;; ((lambda (CN)
;; ((lambda (LX) (if k `(funcall ,k ,lx) lx))
;; `(lambda (,@arguments ,CN)
;; ,@declares
;; ,@(mapcar (rcurry expand expand (append arguments (cons CN env)) CN) body))))
;; (intern "KONT"))))
;; (defcps-expander function-argument-form (name)
;; name)
;; ;; (defcps-expander specialized-function-argument-form (name specializer)
;; ;; )
;; ;; (defcps-expander optional-function-argument-form (name default-value supplied-p-parameter)
;; ;; )
;; ;; (defcps-expander keyword-function-argument-form (keyword-name name default-value supplied-p-parameter)
;; ;; )
;; ;; (defcps-expander allow-other-keys-function-argument-form ()
;; ;; (error "bune-olm-allow-other-keys-falan"))
;; ;; (defcps-expander rest-function-argument-form (name)
;; ;; )
;; ;; (defcps-expander declaration-form ()
;; ;; )
;; ;;;; BLOCK/RETURN-FROM
;; ;; `(block ,name ,@(unwalk-forms body))
;; ;; (defcps-expander block-form (name body)
;; ;; )
;; ;; ;; `(return-from ,(name target-block) ,(unwalk-form result))
;; ;; (defcps-expander return-from-form (target-block result)
;; ;; )
;; ;; ;;;; CATCH/THROW
;; ;; ;; `(catch ,(unwalk-form tag) ,@(unwalk-forms body))
;; ;; (defcps-expander catch-form (tag body)
;; ;; )
;; ;; ;; `(throw ,(unwalk-form tag) ,(unwalk-form value))
;; ;; (defcps-expander throw-form (tag value)
;; ;; )
;; ;; ;;;; EVAL-WHEN
;; ;; (defcps-expander eval-when-form (body eval-when-times)
;; ;; )
;; ;;;; IF
;; (defcps-expander if-form (consequent then arnesi::else)
;; ((lambda (KN)
;; `((lambda (,KN)
;; ,(funcall expand consequent
;; expand env
;; ((lambda (PN)
;; `(lambda (,PN)
;; (if ,PN
;; ,(funcall expand then expand env KN)
;; ,(funcall expand arnesi::else expand env KN))))
;; (gensym "KONT-"))))
;; ,k))
;; (gensym "KONT-")))
;; ;;;; FLET/LABELS
;; ;; The cdadr is here to remove (function (lambda ...)) of the function
;; ;; bindings.
;; ;; (flet ((unwalk-flet (binds)
;; ;; (mapcar #'(lambda (bind)
;; ;; (cons (car bind)
;; ;; (cdadr (unwalk-form (cdr bind)))))
;; ;; binds)))
;; ;; `(flet ,(unwalk-flet binds)
;; ;; ,@(unwalk-declarations declares)
;; ;; ,@(unwalk-forms body)))
;; (defcps-expander flet-form (binds body declares)
;; )
;; (defcps-expander labels-form (binds body declares)
;; (let ((env (append (mapcar #'car binds) env)))
;; `(labels ,(reduce (lambda (acc bind)
;; (cons (cons (car bind)
;; (cdr (funcall expand (cdr bind) expand env nil)))
;; acc))
;; binds :initial-value nil)
;; ,@(mapcar (rcurry expand expand env k) body))))
;; ;;;; LET/LET*
;; (defcps-expander let-form (binds body declares)
;; (funcall expand
;; (walk-form
;; `((lambda (,@(mapcar #'car binds))
;; ,@(mapcar #'unwalk-form declares)
;; ,@(mapcar (compose #'unwalk-form (rcurry expand expand k)) body))
;; ,@(mapcar (compose #'unwalk-form #'cdr) binds)))
;; expand env k))
;; ;; (defcps-expander let*-form (binds body declares)
;; ;; )
;; ;;;; LOAD-TIME-VALUE
;; (defcps-expander arnesi::load-time-value-form (value read-only-p)
;; )
;; ;;;; LOCALLY
;; (defcps-expander locally-form (body declares)
;; )
;; ;;;; MACROLET
;; (defcps-expander macrolet-form (body binds declares)
;; ;; We ignore the binds, because the expansion has already taken
;; ;; place at walk-time.
;; )
;; ;;;; MULTIPLE-VALUE-CALL
;; (defcps-expander multiple-value-call-form (func arguments)
;; (error "unimplemented:multiplave-value-call-form"))
;; ;;;; MULTIPLE-VALUE-PROG1
;; (defcps-expander multiple-value-prog1-form (first-form other-forms)
;; (error "unimplemented:multiple-value-prog1-form"))
;; ;;;; PROGN
;; (defcps-expander progn-form (body)
;; `(progn
;; ,@(mapcar (rcurry expand expand env k) body)))
;; ;;;; PROGV
;; ;; (defunwalker-handler progv-form (body vars-form values-form)
;; ;; `(progv ,(unwalk-form vars-form) ,(unwalk-form values-form) ,@(unwalk-forms body)))
;; ;;;; SETQ
;; (defcps-expander setq-form (var value)
;; )
;; ;;;; SYMBOL-MACROLET
;; ;; We ignore the binds, because the expansion has already taken
;; ;; place at walk-time.
;; ;;; (declare (ignore binds))
;; ;;; `(locally ,@(unwalk-declarations declares) ,@(unwalk-forms body))
;; (defcps-expander symbol-macrolet-form (body binds declares)
;; )
;; ;;;; TAGBODY/GO
;; ;; `(tagbody ,@(unwalk-forms body))
;; (defcps-expander tagbody-form (body)
;; )
;; (defcps-expander go-tag-form (name)
;; )
;; ;;`(go ,name)
;; (defcps-expander go-form (name)
;; )
;; ;;;; THE
;; ;;`(the ,type-form ,(unwalk-form value))
;; (defcps-expander the-form (type-form value)
;; )
;; ;;;; UNWIND-PROTECT
;; (defcps-expander unwind-protect-form (protected-form cleanup-form)
;; )
;; (defcps-expander implicit-progn-mixin (body)
;; )
;; (defcps-expander progn-form (body)
;; `(progn
;; ,@(mapcar (rcurry expand expand env k) body)))
;; (defcps-expander throw-form (tag value)
;; )
;; (defmacro cps (&body body)
;; `(expand-cps (walk-form `(progn ,',@body)) #'expand-cps nil 'k))
;; (defmacro defun/ccc (name args &body body)
;; (progn
;; (eval-when (:compile-toplevel :load-toplevel :execute)
;; (setf (gethash name +cps-functions+) args))
;; (let ((k (intern "KONT")))
;; `(progn
;; (defun ,name (,@args ,k)
;; ,@(mapcar (rcurry #'expand-cps #'expand-cps args k) body))))))
;; (defmacro with-call/ccc (&body body)
;; (let ((result (expand-cps (walk-form `(progn ,@body)) #'expand-cps nil '(lambda (x) x))))
;; `(list ,result)))
;; (defun/ccc abc ()
;; 1)
| 25,858 | Common Lisp | .lisp | 751 | 31.635153 | 108 | 0.578361 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 0f5204ac68d1805bd4f93162725d220d2a980851134217a5407cd1e33b4e34c7 | 8,220 | [
-1
] |
8,221 | successors.lisp | evrim_core-server/src/lisp/successors.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :core-server)
;;+-----------------------------------------------------------------------------
;;| Lisp2 AST Successor
;;+-----------------------------------------------------------------------------
;;
(defgeneric form-successor (form &optional successor)
(:documentation "Returns successors of the 'form'. 'successor' is
used to divert flow."))
(defmethod form-successor :around ((form t) &optional (successor #'form-successor))
(declare (ignore successor))
(nreverse (flatten (call-next-method))))
(defmethod form-successor ((form t) &optional (successor #'form-successor))
(declare (ignore successor))
nil)
(defmethod form-successor ((form implicit-progn-mixin) &optional (successor #'form-successor))
(declare (ignorable successor))
(body form))
(defmethod form-successor ((form application-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(arguments form))
(defmethod form-successor ((form lambda-application-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(cons (operator form) (call-next-method)))
(defmethod form-successor ((form if-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(cons (consequent form) (cons (then form) (else form))))
(defmethod form-successor ((form variable-binding-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(append (mapcar #'cdr (binds form)) (body form)))
(defmethod form-successor ((form function-binding-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(append (mapcar #'cdr (binds form)) (body form)))
(defmethod form-successor ((form return-from-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(result form))
(defmethod form-successor ((form throw-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(value form))
(defmethod form-successor ((form macrolet-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(append (mapcar #'cdr (binds form)) (body form)))
(defmethod form-successor ((form setq-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(list (var form) (value form)))
(defmethod form-successor ((form symbol-macrolet-form) &optional (successor #'form-successor))
(declare (ignorable successor))
(append (mapcar #'cdr (binds form)) (body form)))
| 3,184 | Common Lisp | .lisp | 59 | 51.627119 | 97 | 0.711154 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 42f284285cf1f1a24dda6578ebce071e9db3da634b33c52eab94ca06cc41825d | 8,221 | [
-1
] |
8,222 | twitter.lisp | evrim_core-server/src/clients/twitter.lisp | ;; -------------------------------------------------------------------------
;; Twitter API Implementation
;; -------------------------------------------------------------------------
;; Date: Aug 2012
;; Author: Evrim Ulu <[email protected]>
;; https://dev.twitter.com/docs/auth/implementing-sign-twitter
(in-package :core-server)
;; -------------------------------------------------------------------------
;; Get Request Token
;; -------------------------------------------------------------------------
(defcommand <twitter:get-request-token (<oauth1:get-request-token)
()
(:default-initargs :url "https://api.twitter.com/oauth/request_token"))
;; -------------------------------------------------------------------------
;; Authorize URL
;; -------------------------------------------------------------------------
;; https://api.twitter.com/oauth/authenticate?oauth_token=NPcudxy0yU5T3...
(defun <twitter:authorize-url (&key (token (error "Provide request :token")))
(<oauth1:authorize-url (make-uri :scheme "https"
:server "api.twitter.com"
:paths '(("oauth") ("authorize")))
:token token))
;; -------------------------------------------------------------------------
;; Twitter Access Token
;; -------------------------------------------------------------------------
(defclass+ <twitter:access-token (<oauth1:access-token)
((user-id :host local :accessor <twitter:access-token.user-id)
(screen-name :host local :accessor <twitter:access-token.screen-name))
(:ctor <twitter:%make-access-token))
;; -------------------------------------------------------------------------
;; Get Access Token
;; -------------------------------------------------------------------------
;; An example answer to authorize-url:
;; https://node1.coretal.net/auth.html?oauth_token=6u..&oauth_verifier=d8..
;; (with-slots (consumer-key consumer-secret) (database.get *app* :twitter)
;; (octets-to-string
;; (<twitter:get-access-token :verifier "E5RBHljp1UgFgLTxAyjPQLfOSNtPZokg13PhJlF2wdI"
;; :consumer-key consumer-key
;; :consumer-secret consumer-secret
;; :request-token *x :parse-p nil
;; :debug-p t)
;; :utf-8))
;; "oauth_token=70423595-EJfrzSNjfoAkoLrJAKjhT6g8xFbpp4LzBGCoFE8eU&oauth_token_secret=yPUUQGuBATaYriBUSoO3LfH0nHRGtxdVyUFk8mOQnyc&user_id=70423595&screen_name=evrimulu"
(defcommand <twitter:get-access-token (<oauth1:get-access-token)
()
(:default-initargs :url "https://api.twitter.com/oauth/access_token"))
(defmethod http.evaluate ((self <twitter:get-access-token) result response)
(flet ((get-key (name) (cdr (assoc name result :test #'equal))))
(if (eq (http-response.status-code response) 200)
(values (<twitter:%make-access-token
:token (get-key "oauth_token")
:token-secret (get-key "oauth_token_secret")
:user-id (get-key "user_id")
:screen-name (get-key "screen_name"))
response)
(values result response))))
;; -------------------------------------------------------------------------
;; Secure Get User
;; -------------------------------------------------------------------------
(defcommand <twitter:secure-get-user (<oauth1:secure-funkall)
((screen-name :host local)
(user-id :host local)
(include-entities :host local :initform t))
(:default-initargs :url "https://api.twitter.com/1/users/show.json"
:method 'get))
(defmethod <oauth1:funkall.parameters ((self <twitter:secure-get-user))
(with-slots (screen-name user-id include-entities) self
(cons (if screen-name
`("screen_name" . ,screen-name)
`("user_id" . ,user-id))
(if include-entities
(cons `("include_entities" . "true") (call-next-method self))
(call-next-method self)))))
(defmethod http.setup-uri ((self <twitter:secure-get-user))
(with-slots (screen-name user-id include-entities) self
(when (and (null screen-name) (null user-id))
(error "One of :screen-name or :user-id must be provided.")))
(call-next-method self))
;; -------------------------------------------------------------------------
;; Twitter Funkall (depreciated)
;; -------------------------------------------------------------------------
;; https://dev.twitter.com/docs/api
(defcommand <twitter:funkall (http)
((cmd :host local :initform (error "Provide :cmd")))
(:default-initargs :url "http://api.twitter.com/1/"))
(defcommand <twitter:get-user-lists (<twitter:funkall)
((username :host local :initform (error "Provide :username")))
(:default-initargs
:cmd t
:url "http://twitter.com/goodies/list_of_lists"))
(defmethod run ((self <twitter:get-user-lists))
(http.add-query self "screen_name" (s-v 'username))
(let ((result (call-next-method self)))
(awhen result
(getf (jobject.attributes (json-deserialize (octets-to-string result :utf-8))) :lists))))
;; STAGE 1.
;; MANAGER> (with-slots (consumer-key consumer-secret) (database.get *app* :twitter)
;; (<twitter:get-request-token :callback "http://node1.coretal.net/auth.html"
;; :consumer-key consumer-key
;; :consumer-secret consumer-secret
;; :debug-p nil))
;; #<<OAUTH1:REQUEST-TOKEN {100A32A843}>
;; #<HTTP-RESPONSE (200 . OK) {100A31F063}>
;; MANAGER> (setf *x *)
;; #<<OAUTH1:REQUEST-TOKEN {100A32A843}>
;; MANAGER> (describe *x)
;; #<<OAUTH1:REQUEST-TOKEN {100A32A843}>
;; [standard-object]
;; Slots with :INSTANCE allocation:
;; TOKEN = "sbkzpK6VGbkC2wpAUW4AkWvwTwXEGyNlbNzVwfjO1Qc"
;; TOKEN-SECRET = "82SvLHDgGPdFrn19asizzmRoW0c7Mx14nRdQXWNBs"
;; CALLBACK-CONFIRMED = TRUE
;; ; No value
;; STAGE 2.
;; MANAGER> (uri->string (<twitter:authorize-url :token *x))
;; "https://api.twitter.com/oauth/authorize?oauth_token=sbkzpK6VGbkC2wpAUW4AkWvwTwXEGyNlbNzVwfjO1Qc"
;; MANAGER> (setf *verifier "zlpTUE70IDvWXcKeHTPX8F6g44JsDEd35XgZT3aNE6g")
;; "zlpTUE70IDvWXcKeHTPX8F6g44JsDEd35XgZT3aNE6g"
;; STAGE 3.
;; Twitter redirects to:
;; http://node1.coretal.net/auth.html?oauth_token=M5JgfX6wlMbIqx9KoV0MXCpHNLsleziMmvTEtQqA&oauth
;; _verifier=qCfX9zfDWrWwaG8Zp2u1zlg76vcby6ssdGLivmcrQjY
;; Let's evaluate:
;; MANAGER> (with-slots (consumer-key consumer-secret) (database.get *app* :twitter)
;; (<twitter:get-access-token :verifier *verifier
;; :consumer-key consumer-key
;; :consumer-secret consumer-secret
;; :request-token *x
;; :debug-p nil))
;; #<<TWITTER:ACCESS-TOKEN {1004811673}>
;; #<HTTP-RESPONSE (200 . OK) {10047341D3}>
;; MANAGER> (describe *)
;; #<<TWITTER:ACCESS-TOKEN {1004811673}>
;; [standard-object]
;; Slots with :INSTANCE allocation:
;; TOKEN = "70423595-EJfrzSNjfoAkoLrJAKjhT6g8xFbpp4LzBGCoFE8eU"
;; TOKEN-SECRET = "yPUUQGuBATaYriBUSoO3LfH0nHRGtxdVyUFk8mOQnyc"
;; USER-ID = "70423595"
;; SCREEN-NAME = "evrimulu"
;; ; No value
| 6,814 | Common Lisp | .lisp | 140 | 46.378571 | 168 | 0.590711 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | fd960394c2a146f74210b01f3b4014f702dfc5ce08d1224678a9b56296f0ee20 | 8,222 | [
-1
] |
8,223 | yahoo.lisp | evrim_core-server/src/clients/yahoo.lisp | ;; -------------------------------------------------------------------------
;; Yahoo API Implementation
;; -------------------------------------------------------------------------
;; Date: Aug 2012
;; Author: Evrim Ulu <[email protected]>
;; http://developer.yahoo.com/oauth/guide/oauth-requesttoken.html
(in-package :core-server)
;; -------------------------------------------------------------------------
;; Yahoo Request Token
;; -------------------------------------------------------------------------
(defclass+ <yahoo:request-token (<oauth1:request-token)
((expires-in :host local)
(request-auth-url :host local))
(:ctor <yahoo:%make-request-token))
;; -------------------------------------------------------------------------
;; Get Request Token
;; -------------------------------------------------------------------------
(defcommand <yahoo:get-request-token (<oauth1:get-request-token)
((lang-pref :host local :initform "en-us"))
(:default-initargs :url "https://api.login.yahoo.com/oauth/v2/get_request_token"))
(defmethod <oauth1:funkall.parameters ((self <yahoo:get-request-token))
`(,@(call-next-method self)
("xoauth_lang_pref" . ,(slot-value self 'lang-pref))))
(defmethod http.evaluate ((self <yahoo:get-request-token) result response)
(flet ((get-key (name) (cdr (assoc name result :test #'equal))))
(if (eq (http-response.status-code response) 200)
(values (<yahoo:%make-request-token
:token (get-key "oauth_token")
:token-secret (get-key "oauth_token_secret")
:callback-confirmed (json-deserialize
(get-key "oauth_callback_confirmed"))
:expires-in (json-deserialize (get-key "oauth_expires_in"))
:request-auth-url (get-key "xoauth_request_auth_url"))
response)
(values result response))))
;; -------------------------------------------------------------------------
;; Authorize URL
;; -------------------------------------------------------------------------
;; https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=hwyun4h
(defun <yahoo:authorize-url (&key (token (error "Provide request :token")))
(<oauth1:authorize-url (make-uri :scheme "https"
:server "api.login.yahoo.com"
:paths '(("oauth") ("v2") ("request_auth")))
:token token))
;; -------------------------------------------------------------------------
;; Yahoo Access Token
;; -------------------------------------------------------------------------
(defclass+ <yahoo:access-token (<oauth1:access-token)
((session-handle :host local)
(expires-in :host local)
(authorization-expires-in :host local)
(yahoo-guid :host local))
(:ctor <yahoo:%make-access-token))
;; -------------------------------------------------------------------------
;; Get Access Token
;; -------------------------------------------------------------------------
(defcommand <yahoo:get-access-token (<oauth1:get-access-token)
()
(:default-initargs :url "https://api.login.yahoo.com/oauth/v2/get_token"
:method 'get))
(defmethod <oauth1:funkall.parameters ((self <yahoo:get-access-token))
(with-slots (request-token verifier) self
(with-slots (token-secret) request-token
`(,@(call-next-method self) ("oauth_verifier" . ,verifier)))))
(defmethod http.evaluate ((self <yahoo:get-access-token) result response)
(flet ((get-key (name) (cdr (assoc name result :test #'equal))))
(if (eq (http-response.status-code response) 200)
(values (<yahoo:%make-access-token
:token (get-key "oauth_token")
:token-secret (get-key "oauth_token_secret")
:expires-in (get-key "oauth_expires_in")
:session-handle (get-key "oauth_session_handle")
:authorization-expires-in (get-key "oauth_authorization_expires_in")
:yahoo-guid (get-key "xoauth_yahoo_guid"))
response)
(values result response))))
;; -------------------------------------------------------------------------
;; Secure Get User
;; -------------------------------------------------------------------------
(defcommand <yahoo:secure-get-user (<oauth1:secure-funkall)
((guid :host local))
(:default-initargs :url "http://social.yahooapis.com/v1/user/"
:method 'get))
(defmethod http.setup-uri ((self <yahoo:secure-get-user))
(with-slots (url) self
(let ((url (if (stringp url)
(uri? (make-core-stream url))
url)))
(with-slots (guid) self
(setf (uri.paths url) (append (uri.paths url) `((,guid) ("profile")))
(slot-value self 'url) url)
(http.add-query self "format" "json")
(http.add-query self "count" "max")
(call-next-method self)))))
;; MANAGER> (json! *core-output* *f)
;; {
;; "profile": {
;; "isConnected": false,
;; "profileUrl": 'http://profile.yahoo.com/2GH5FHPKWXNH4V4M2CYGPYESZY',
;; "nickname": 'Evrim',
;; "memberSince": '2011-07-06T20:56:34Z',
;; "image": {
;; "width": 192,
;; "size": '192x192',
;; "imageUrl": 'http://l.yimg.com/a/i/identity2/profile_192b.png',
;; "height": 192 }
;; ,
;; "created": '2012-08-19T17:54:16Z',
;; "bdRestricted": true,
;; "guid": '2GH5FHPKWXNH4V4M2CYGPYESZY',
;; "uri": 'http://social.yahooapis.com/v1/user/2GH5FHPKWXNH4V4M2CYGPYESZY/profile' }
;; } | 5,110 | Common Lisp | .lisp | 112 | 42.794643 | 84 | 0.541809 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 46d53c0a2c878334bd1cc1ff19684502b60b3f2bcaf6821da3e6786d5a90ecaf | 8,223 | [
-1
] |
8,224 | google.lisp | evrim_core-server/src/clients/google.lisp | ;; -------------------------------------------------------------------------
;; Google OAuth 2.0 API
;; -------------------------------------------------------------------------
;; https://developers.google.com/accounts/docs/OAuth2Login
;; https://developers.google.com/accounts/docs/OAuth2WebServer
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2012
(in-package :core-server)
;; -------------------------------------------------------------------------
;; OAuth Dialog
;; -------------------------------------------------------------------------
;; 1. Generate an OAuth Dialog URI
;; https://accounts.google.com/o/oauth2/auth
(defun make-google-oauth-uri (&key paths queries)
(make-uri :scheme "https" :server "accounts.google.com"
:paths paths :queries queries))
(defvar +google-oauth-scope+
(concat "https://www.googleapis.com/auth/userinfo.profile "
"https://www.googleapis.com/auth/userinfo.email"))
(defun <google:oauth-uri (&key (client-id (error "Provide :client-id"))
(redirect-uri (error "provide :redirect-uri"))
(scope +google-oauth-scope+)
(response-type "code")
(state nil))
(<oauth2:oauth-uri (make-google-oauth-uri :paths '(("o") ("oauth2") ("auth")))
:client-id client-id :redirect-uri redirect-uri
:scope scope :response-type response-type :state state))
;; -------------------------------------------------------------------------
;; Get Access Token
;; -------------------------------------------------------------------------
;; 3. Get Access Token
;; (<google:get-access-token :client-id ".." :client-secret "..."
;; :code *code :redirect-uri *uri)
;; ((timestamp . 3187371)
;; ("access_token" . "AAACT3RIWEo0BANaEBCQDRBb.. ..glX8ZC6iZBpNue3uWRBiubZBdYMtQZDZD")
;; ("expires" . "4889"))
(defcommand <google:get-access-token (<oauth2:get-access-token)
()
(:default-initargs :method 'post
:url (make-google-oauth-uri :paths `(("o") ("oauth2") ("token")))))
(defmethod http.setup-uri ((self <google:get-access-token))
(if (stringp (s-v 'url))
(setf (s-v 'url) (uri? (make-core-stream (s-v 'url)))))
#+ssl
(if (and (http.ssl-p self) (null (uri.port (s-v 'url))))
(setf (uri.port (s-v 'url)) 443))
(with-slots (client-id client-secret code redirect-uri) self
(mapcar (lambda (a)
(destructuring-bind (key . value) a
(http.add-post self key value)))
`(("client_id" . ,client-id)
("client_secret" . ,client-secret)
("code" . ,code)
("redirect_uri" . ,(typecase redirect-uri
(string redirect-uri)
(uri (uri->string redirect-uri))))
("grant_type" . "authorization_code")))
(s-v 'url)))
(defcommand <google:userinfo (<oauth2:authorized-funkall)
()
(:default-initargs
:url (make-uri :scheme "https" :server "www.googleapis.com"
:paths `(("oauth2") ("v1") ("userinfo")))))
;; +-------------------------------------------------------------------------
;; | Depreciated OpenID Code
;; +-------------------------------------------------------------------------
;; ;; Below code is the previous version of this api, namely OpenID (./openid.lisp).
;; ;; It is depreciated. Google and fellows now use OAuth 2.0 now. -evrim.
;; ;; -------------------------------------------------------------------------
;; ;; Google OpenId Associate
;; ;; -------------------------------------------------------------------------
;; (defcommand <google:associate (<openid:associate)
;; ()
;; (:default-initargs :url "https://www.google.com/accounts/o8/ud"))
;; ;; (+ "http://www.google.com/accounts/o8/ud?"
;; ;; "&openid.ns=http://specs.openid.net/auth/2.0"
;; ;; "&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select"
;; ;; "&openid.identity=http://specs.openid.net/auth/2.0/identifier_select"
;; ;; "&openid.return_to=http://node1.coretal.net/auth_3rd_party.core?type=google"
;; ;; "&openid.realm=http://node1.coretal.net/"
;; ;; "&openid.mode=checkid_setup"
;; ;; "&openid.assoc_handle=" (encode-u-r-i-component (google-assoc-handle self))
;; ;; "&openid.ui.ns=http://specs.openid.net/extensions/ui/1.0"
;; ;; "&openid.ui.mode=popup&openid.ui.icon=true"
;; ;; "&openid.ns.ax=http://openid.net/srv/ax/1.0"
;; ;; "&openid.ax.mode=fetch_request"
;; ;; "&openid.ax.type.language=http://axschema.org/pref/language"
;; ;; "&openid.ax.type.country=http://axschema.org/contact/country/home"
;; ;; "&openid.ax.type.email=http://axschema.org/contact/email"
;; ;; "&openid.ax.type.firstname=http://axschema.org/namePerson/first"
;; ;; "&openid.ax.type.lastname=http://axschema.org/namePerson/last"
;; ;; "&openid.ax.required=language,country,lastname,firstname,email")
;; ;; -------------------------------------------------------------------------
;; ;; Google OpenId Request Authentication
;; ;; -------------------------------------------------------------------------
;; (defcommand <google:request-authentication (<openid:request-authentication)
;; ())
;; (defmethod run ((self <google:request-authentication))
;; (http.add-post self "openid.ui.ns"
;; "http://specs.openid.net/extensions/ui/1.0")
;; (http.add-post self "openid.ui.mode" "popup")
;; (http.add-post self "openid.ui.icon" "true")
;; (http.add-post self "openid.ns.ax" "http://openid.net/srv/ax/1.0")
;; (http.add-post self "openid.ax.mode" "fetch_request")
;; (http.add-post self "openid.ax.type.language"
;; "http://axschema.org/pref/language")
;; (http.add-post self "openid.ax.type.country"
;; "http://axschema.org/contact/country/home")
;; (http.add-post self "openid.ax.type.email"
;; "http://axschema.org/contact/email")
;; (http.add-post self "openid.ax.type.firstname"
;; "http://axschema.org/namePerson/first")
;; (http.add-post self "openid.ax.type.lastname"
;; "http://axschema.org/namePerson/last")
;; (http.add-post self "openid.ax.required"
;; "language,country,lastname,firstname,email")
;; (call-next-method self))
;; ;; -------------------------------------------------------------------------
;; ;; Google OpenId Verify Authentication
;; ;; -------------------------------------------------------------------------
;; (defcommand <google:verify-authentication (<openid:verify-authentication)
;; ())
;; ;; -------------------------------------------------------------------------
;; ;; Google exTract Authentication
;; ;; -------------------------------------------------------------------------
;; (defcommand <google:extract-authentication (<openid:funkall)
;; ()
;; (:default-initargs :url (error "Provide :url")
;; :mode t))
;; (defmethod run ((self <google:extract-authentication))
;; (with-slots (url) self
;; (list :name (format nil "~A ~A"
;; (uri.query url "openid.ext1.value.firstname")
;; (uri.query url "openid.ext1.value.lastname"))
;; :email (uri.query url "openid.ext1.value.email")
;; :country (uri.query url "openid.ext1.value.country")
;; :language (uri.query url "openid.ext1.value.language")))) | 7,054 | Common Lisp | .lisp | 137 | 49.131387 | 87 | 0.545283 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | ceff322cd4f5e80205e41d2451ee251bc3edff3e0043075be29db53643489825 | 8,224 | [
-1
] |
8,225 | oauth-v1.lisp | evrim_core-server/src/clients/oauth-v1.lisp | ;; -------------------------------------------------------------------------
;; OAuth 1.0 Protocol Implementation aka RFC 5849
;; -------------------------------------------------------------------------
;; http://tools.ietf.org/html/rfc5849
;; Date: Aug 2012
;; Author: Evrim Ulu <[email protected]>
(in-package :core-server)
;; OAuth 1.0 Flow:
;; http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html
;; Similar to openID spec with signatures, assumed to be CCA-2 compliant.
;; -------------------------------------------------------------------------
;; OAuth Request Token
;; -------------------------------------------------------------------------
(defclass+ <oauth1:request-token ()
((token :host local :initform (error "Provide :token")
:accessor <oauth1:request-token.token)
(token-secret :host local :initform (error "Provide :token-secret")
:accessor <oauth1:request-token.token-secret)
(callback-confirmed :host local :initform nil
:accessor <oauth1:request-token.callback-confirmed))
(:ctor <oauth1:%make-request-token))
;; -------------------------------------------------------------------------
;; OAuth Funkall
;; -------------------------------------------------------------------------
(defcommand <oauth1:funkall (http)
((mode :host local :initform :query :documentation "Can be :header or :query")
(consumer-key :host local :initform (error "Provide :consumer-key"))
(consumer-secret :host local :initform (error "Provide :consumer-secret"))
(version :host local :initform "1.0")
(signature-method :host local :initform "HMAC-SHA1"))
(:default-initargs :method 'post))
(defmethod <oauth1:funkall.signature-key ((self <oauth1:funkall))
(concat (escape-as-uri (slot-value self 'consumer-secret)) "&"))
(defmethod <oauth1:funkall.sign ((self <oauth1:funkall) (string string))
(with-slots (signature-method) self
;; http://oauth.net/core/1.0/#sig_base_example 9.2
(let ((key (<oauth1:funkall.signature-key self)))
(cond
((equal "HMAC-SHA1" signature-method)
(let ((mac (cadr (multiple-value-list (hmac key string :sha1)))))
(with-core-stream (s "")
(base64! s mac)
(return-stream s))))
;; ((equal "PLAINTEXT" signature-method) consumer-secret)
(t (error "Unsupported signature-method ~A" signature-method))))))
(defmethod <oauth1:funkall.build-signature ((self <oauth1:funkall) parameters)
(with-slots (url method) self
(with-slots (scheme server port paths) url
(flet ((one (a)
(destructuring-bind (key . value) a
(escape-as-uri (concat key "=" (escape-as-uri value))))))
(let ((parameters (sort (copy-list (append (uri.queries url) parameters))
#'string< :key #'car)))
(reduce (lambda (acc parameter)
(concat acc (escape-as-uri "&") (one parameter)))
(cdr parameters)
:initial-value
(concat (symbol-name method) "&"
(escape-as-uri
(uri->string (make-uri :scheme scheme :server server
:port port :paths paths)))
"&" (one (car parameters)))))))))
(defmethod <oauth1:funkall.parameters ((self <oauth1:funkall))
(with-slots (consumer-key callback version signature-method url) self
(let ((nonce (random-string 32))
(timestamp (format nil "~A" (get-unix-time))))
`(("oauth_consumer_key" . ,consumer-key)
("oauth_nonce" . ,nonce)
("oauth_signature_method" . ,signature-method)
("oauth_timestamp" . ,timestamp)
("oauth_version" . ,version)))))
(defmethod <oauth1:funkall.header ((self <oauth1:funkall))
(let* ((parameters (<oauth1:funkall.parameters self))
(str-to-sign (<oauth1:funkall.build-signature self parameters)))
(cons `("oauth_signature" . ,(<oauth1:funkall.sign self str-to-sign))
parameters)))
;; If we are in :header mode, then add an Authorization: OAuth header
(defmethod http.make-request ((self <oauth1:funkall))
(let ((req (call-next-method self)))
(when (eq :header (slot-value self 'mode))
(let ((parameters (mapcar (lambda (a)
(destructuring-bind (key . value) a
`(,key . ,(escape-as-uri value))))
(<oauth1:funkall.header self))))
(http-request.add-request-header req 'authorization
`(oauth ,@parameters))))
req))
;; Otherwise, we are in :query mode, add query parameters
(defmethod http.setup-uri ((self <oauth1:funkall))
(let ((url (call-next-method self)))
(when (eq :query (slot-value self 'mode))
(mapcar (lambda (a)
(destructuring-bind (key . value) a
(uri.add-query url key value)))
(reverse (<oauth1:funkall.header self))))
url))
;; -------------------------------------------------------------------------
;; OAuth Get Request Token
;; -------------------------------------------------------------------------
;; Stage 1. Obtain a REQUEST TOKEN
(defcommand <oauth1:get-request-token (<oauth1:funkall)
((callback :host local :initform (error "Provide :callback"))))
(defmethod <oauth1:funkall.parameters ((self <oauth1:get-request-token))
(with-slots (callback) self
(let ((parameters (call-next-method self)))
(cons `("oauth_callback" . ,(typecase callback
(string callback)
(uri (uri->string callback))))
parameters))))
(defmethod http.parse-response ((self <oauth1:get-request-token)
(stream core-fd-io-stream))
(let ((response (call-next-method self stream)))
(prog1 response
(setf (http-response.entities response)
(aif (http-response.entities response)
(query? (make-core-stream (car it)))
(query? (http-response.stream response)))))))
(defmethod http.evaluate ((self <oauth1:get-request-token) result response)
(flet ((get-key (name) (cdr (assoc name result :test #'equal))))
(if (eq (http-response.status-code response) 200)
(values (<oauth1:%make-request-token
:token (get-key "oauth_token")
:token-secret (get-key "oauth_token_secret")
:callback-confirmed (json-deserialize
(get-key "oauth_callback_confirmed")))
response)
(values result response))))
;; -------------------------------------------------------------------------
;; OAuth Authorize Url
;; -------------------------------------------------------------------------
;; STAGE 2. Redirect user to AUTHORIZATION URL
(defmethod <oauth1:authorize-url ((base-url uri)
&key (token (error "Provide request :token")))
(prog1 base-url
(uri.add-query base-url "oauth_token"
(typecase token
(string token)
(<oauth1:request-token (slot-value token 'token))))))
;; -------------------------------------------------------------------------
;; OAuth Access Token
;; -------------------------------------------------------------------------
(defclass+ <oauth1:access-token ()
((token :host local)
(token-secret :host local))
(:ctor <oauth1:%make-access-token))
;; -------------------------------------------------------------------------
;; OAuth Get Access Token
;; -------------------------------------------------------------------------
;; StAGE 3. Get an ACCESS TOKEN
(defcommand <oauth1:get-access-token (<oauth1:funkall)
((verifier :host local :initform (error "Provide :verifier"))
(request-token :host local :initform (error "Provide :request-token"))))
(defmethod <oauth1:funkall.signature-key ((self <oauth1:get-access-token))
(with-slots (consumer-secret request-token) self
(concat (escape-as-uri consumer-secret) "&"
(escape-as-uri (slot-value request-token 'token-secret)))))
(defmethod <oauth1:funkall.parameters ((self <oauth1:get-access-token))
(with-slots (request-token) self
(with-slots (token) request-token
(let ((parameters (call-next-method self)))
(cons `("oauth_token" . ,token) parameters)))))
(defmethod http.setup-uri ((self <oauth1:get-access-token))
(let ((url (call-next-method self)))
(with-slots (verifier) self
(with-slots (token) (slot-value self 'request-token)
(prog1 url
(http.add-post self "oauth_token" token)
(http.add-post self "oauth_verifier" verifier))))))
(defmethod http.parse-response ((self <oauth1:get-access-token)
(stream core-fd-io-stream))
(let ((response (call-next-method self stream)))
(prog1 response
(setf (http-response.entities response)
(aif (http-response.entities response)
(query? (make-core-stream (car it)))
(query? (http-response.stream response)))))))
(defmethod http.evaluate ((self <oauth1:get-access-token) result response)
(flet ((get-key (name) (cdr (assoc name result :test #'equal))))
(if (eq (http-response.status-code response) 200)
(values (<oauth1:%make-access-token
:token (get-key "oauth_token")
:token-secret (get-key "oauth_token_secret"))
response)
(values result response))))
;; -------------------------------------------------------------------------
;; Secure Funkall
;; -------------------------------------------------------------------------
(defcommand <oauth1:secure-funkall (<oauth1:funkall)
((token :host local :initform (error "Provide :token")))
(:default-initargs :method 'get))
(defmethod <oauth1:funkall.signature-key ((self <oauth1:secure-funkall))
(with-slots (consumer-secret token) self
(concat (escape-as-uri consumer-secret) "&"
(escape-as-uri (slot-value token 'token-secret)))))
(defmethod <oauth1:funkall.parameters ((self <oauth1:secure-funkall))
(with-slots (token) self
(cons `("oauth_token" . ,(typecase token
(<oauth1:access-token (slot-value token 'token))
(string token)))
(call-next-method self))))
(deftrace oauth1 '(<oauth1:funkall.header <oauth1:funkall.build-signature
<oauth1:funkall.sign <oauth1:funkall.signature-key
<oauth1:funkall.parameters
<oauth1:authorize-url <oauth1:get-request-token
<oauth1:%make-request-token <oauth1:get-access-token))
;; https://dev.twitter.com/docs/api/1/post/oauth/request_token
;; Authorization Header:
;; OAuth oauth_nonce= "K7ny27JTpKVsTgdyLdDfmQQWVLERj2zAK5BslRsqyw", oauth_callback= "http%3A%2F%2Fmyapp.com%3A3005%2Ftwitter%2Fprocess_callback", oauth_signature_method= "HMAC-SHA1", oauth_timestamp= "1300228849", oauth_consumer_key= "OqEqJeafRSF11jBMStrZz", oauth_signature= "Pc%2BMLdv028fxCErFyi8KXFM%2BddU%3D", oauth_version= "1.0"
;; AUTHORIZATION: oauth oauth_callback="http%3A%2F%2Fnode1.coretal.net%3A8080%2Fauth.html%3Faction%3Danswer%26provider%3Dtwitter",oauth_consumer_key="RLdbWgOhvyLsL7x1Lxryw",oauth_nonce="lkqBmezOneWUjvkbWSEXcxtWwmnzNDxq",oauth_signature="ZjJhOGJlNDYwNzhlYjc2YjYxYmVhMmU5YzVjZGNiOGU3ZmVkNDQ4OQ%3D%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1344310881",oauth_version="1.0"
;; USER-AGENT: [Core-serveR] (http://labs.core.gen.tr)
;; (defparameter +timestamp+ "1318467427")
;; (defparameter +nonce+ "ea9ec8429b68d6b77cd5600adbbb0456")
;; (in-package :manager)
;; (defparameter *key "cChZNFj6T5R0TigYB9yd1w")
;; (defparameter *secret "L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg")
;; (defparameter *callback (unescape-as-uri"http%3A%2F%2Flocalhost%2Fsign-in-with-twitter%2F"))
;; (defparameter *result "F1Li3tvehgcraF8DMJ7OyxO4w9Y%3D")
;; http://tools.ietf.org/html/rfc5849#section-3.4
;; POST&http%3A%2F%2Fexample.com%2Frequest&a2%3Dr%2520b%26a3%3D2%2520q
;; %26a3%3Da%26b5%3D%253D%25253D%26c%2540%3D%26c2%3D%26oauth_consumer_
;; key%3D9djdj82h48djs9d2%26oauth_nonce%3D7d8f3e4a%26oauth_signature_m
;; ethod%3DHMAC-SHA1%26oauth_timestamp%3D137131201%26oauth_token%3Dkkk
;; 9d7dh3k39sjv7
;; https://photos.example.net/request_token?oauth_consumer_key=dpf43f3p2l4k3l03&oauth_signature_method=PLAINTEXT&oauth_signature=kd94hf93k423kf44%26&oauth_timestamp=1191242090&oauth_nonce=hsu94j3884jdopsl&oauth_version=1.0
;; #<URI https://photos.example.net/(request_token)?
;; (oauth_consumer_key . dpf43f3p2l4k3l03)
;; (oauth_signature_method . PLAINTEXT)
;; (oauth_signature . kd94hf93k423kf44&)
;; (oauth_timestamp . 1191242090)
;; (oauth_nonce . hsu94j3884jdopsl)
;; (oauth_version . 1.0)# {101371CEB3}>
;; (uri->string (uri? (make-core-stream "https://photos.example.net/request_token?oauth_consumer_key=dpf43f3p2l4k3l03&oauth_signature_method=PLAINTEXT&oauth_signature=kd94hf93k423kf44%26&oauth_timestamp=1191242090&oauth_nonce=hsu94j3884jdopsl&oauth_version=1.0")))
;; https://api.twitter.com/oauth/request_token?oauth_consumer_key=RLdbWgOhvyLsL7x1Lxryw&oauth_nonce=UDxrfQCZZMLMUKraCiHaliXVnSLplcjn&oauth_signature_method=PLAINTEXT&oauth_timestamp=1344373681&oauth_version=1.0&oauth_signature=dsMKwAquRgGYog72YXvJqRDOYlWjXpHJWZa4u6yKU%26
;; #<URI https://api.twitter.com/(oauth)/(request_token)?
;; (oauth_consumer_key . RLdbWgOhvyLsL7x1Lxryw)
;; (oauth_signature_method . PLAINTEXT)
;; (oauth_signature . dsMKwAquRgGYog72YXvJqRDOYlWjXpHJWZa4u6yKU&)
;; (oauth_timestamp . 1344373681)
;; (oauth_nonce . UDxrfQCZZMLMUKraCiHaliXVnSLplcjn)
;; (oauth_version . 1.0)
;; # {1013A433B3}>
;; (with-slots (consumer-key consumer-secret) (database.get *app* :twitter)
;; (octets-to-string
;; (<oauth1:get-request-token :callback "https://node1.coretal.net/auth.html"
;; :consumer-key consumer-key
;; :consumer-secret consumer-secret
;; :debug-p t :parse-p nil)
;; :utf-8))
;; "oauth_token=v13hTVvdzG84dlHvllb07igPkf3FgPTJAKRHrBPO06s&oauth_token_secret=KzhK8dkVMdFOXM5ObqTEY5D9YVtfdxNU54ORmhEaQY&oauth_callback_confirmed=true"
| 13,229 | Common Lisp | .lisp | 249 | 49.799197 | 382 | 0.65541 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | a0e70ecfbef3179fb14859bbe97b73fee22c4d25d7cd1064d0331bbb18142e85 | 8,225 | [
-1
] |
8,226 | oauth-v2.lisp | evrim_core-server/src/clients/oauth-v2.lisp | ;; -------------------------------------------------------------------------
;; OAuth 2.0 Protocol Implementation
;; -------------------------------------------------------------------------
;; Date: Aug 2012
;; Author: Evrim Ulu <[email protected]>
(in-package :core-server)
;; No signatures in this protocol,
;; See this discussion here,
;; http://hueniverse.com/2010/09/oauth-2-0-without-signatures-is-bad-for-the-web/
;; 1. Pop-up a dialog using <oauth2:oauth-uri
;; 2. Get *code* parameter in the return-uri <not here>
;; 3. Get an access token
;; 4. Use <oauth2: commands and make api calls to service.
;; -------------------------------------------------------------------------
;; OAuth Dialog
;; -------------------------------------------------------------------------
;; 1. Generate an OAuth Dialog URI
(defmethod <oauth2:oauth-uri ((base-url uri)
&key
(client-id (error "Provide :client-id"))
(redirect-uri (error "Provide :redirect-uri"))
(scope "email")
(response-type "code")
(state nil))
(setf (uri.queries base-url)
`(("client_id" . ,client-id)
("response_type" . ,response-type)
("scope" . ,scope)
("redirect_uri" . ,(typecase redirect-uri
(uri (uri->string redirect-uri))
(string redirect-uri)))))
(if state
(uri.add-query base-url "state" state)
base-url))
;; -------------------------------------------------------------------------
;; OAuth Exception
;; -------------------------------------------------------------------------
(define-condition <oauth2:exception (error)
((code :initarg :code :reader <oauth2:exception.code)
(type :initarg :type :reader <oauth2:exception.type)
(message :initarg :message :reader <oauth2:exception.message))
(:report (lambda (condition stream)
(with-slots (code type message) condition
(format stream "~A:~A:~A" code type message))))
(:documentation "OAuth Style Conditions"))
;; -------------------------------------------------------------------------
;; OAuth Command
;; -------------------------------------------------------------------------
(defcommand <oauth2:funkall (http)
())
(defmethod http.evaluate ((self <oauth2:funkall) result response)
(if (eq 200 (http-response.status-code response))
(return-from http.evaluate (values result response)))
(let ((error (get-attribute result :error)))
(if error
(values (make-condition '<oauth2:exception
:code (get-attribute error :code)
:type (get-attribute error :type)
:message (get-attribute error :message))
response)
(values result response))))
;; -------------------------------------------------------------------------
;; Access Token
;; -------------------------------------------------------------------------
(defclass+ <oauth2:access-token ()
((timestamp :host local :accessor <oauth2:access-token.timestamp
:initform (get-universal-time))
(expires :host local :accessor <oauth2:access-token.expires)
(token :host local :accessor <oauth2:access-token.token)
(id-token :host local :accessor <oauth2:access-token.id-token)
(token-type :host local :accessor <oauth2:access-token.token-type))
(:ctor <oauth2:%make-access-token))
;; 3. Get Access Token
;; (<oauth2:get-access-token :client-id ".." :client-secret "..."
;; :code *code :redirect-uri *uri)
;; ((timestamp . 3187371)
;; ("access_token" . "AAACT3RIWEo0BANaEBCQDRBb.. ..glX8ZC6iZBpNue3uWRBiubZBdYMtQZDZD")
;; ("expires" . "4889"))
(defcommand <oauth2:get-access-token (<oauth2:funkall)
((client-id :initform (error "Provide :client-id") :host local)
(client-secret :initform (error "Provide :client-secret") :host local)
(code :initform (error "Provide :code") :host local)
(redirect-uri :initform (error "Provide :redirect-uri") :host local))
(:default-initargs
:url (make-google-oauth-uri :paths `(("oauth") ("access_token")))))
(defmethod http.setup-uri ((self <oauth2:get-access-token))
(with-slots (client-id client-secret code redirect-uri) self
(let ((uri (call-next-method self)))
(setf (uri.queries uri)
`(("client_id" . ,client-id)
("client_secret" . ,client-secret)
("code" . ,code)
("redirect_uri" . ,(typecase redirect-uri
(string redirect-uri)
(uri (uri->string redirect-uri))))))
uri)))
(defmethod http.evaluate ((self <oauth2:get-access-token) result response)
(let ((content-type (http-response.get-content-type response)))
(cond
((and (equal "application" (car content-type))
(equal "json" (cadr content-type)))
(with-attributes (id_token expires_in token_type access_token) result
(values (<oauth2:%make-access-token
:expires expires_in :token access_token
:id-token id_token :token-type token_type)
response)))
(t
(flet ((get-key (key result) (cdr (assoc key result :test #'string=))))
(let* ((result (query? (make-core-stream result))))
(values (<oauth2:%make-access-token
:timestamp (get-universal-time)
:expires (parse-integer (get-key "expires" result))
:token (get-key "access_token" result))
response)))))))
;; -------------------------------------------------------------------------
;; OAuth Authorized Funkall
;; -------------------------------------------------------------------------
(defcommand <oauth2:authorized-funkall (<oauth2:funkall)
((token :host local :initform (error "Provide :token"))))
(defmethod http.setup-uri ((self <oauth2:authorized-funkall))
(with-slots (token) self
(let ((uri (call-next-method self)))
(typecase token
(string
(http.add-query self "access_token" token))
(<oauth2:access-token
(http.add-query self "access_token" (<oauth2:access-token.token token))))
uri)))
| 5,789 | Common Lisp | .lisp | 128 | 41.414063 | 87 | 0.570897 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 94e328bcd7eba6e40286dde477ff2c0fef8bf4f11c36dba76bbd61b3793fbb81 | 8,226 | [
-1
] |
8,227 | paypal.lisp | evrim_core-server/src/clients/paypal.lisp | (in-package :core-server)
;; +-------------------------------------------------------------------------
;; | PayPal Interface
;; +-------------------------------------------------------------------------
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2011
;; Reference:
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_NVPAPIOverview
;; API Servers for API Signature Security
;; If you use an API signature, post the request to one of these servers:
;; Sandbox: https://api-3t.sandbox.paypal.com/nvp
;; Live: https://api-3t.paypal.com/nvp
;; API Servers for API Certificate Security
;; If you use an API certificate, post the request to one of these servers:
;; Sandbox: https://api.sandbox.paypal.com/nvp
;; Live: https://api.paypal.com/nvp
;; Test AccountDate Created
;; Jun. 13, 2011 14:35:36 PDT
;; Test Account:[email protected]
;; API Username:seller_1308000922_biz_api1.core.gen.tr
;; API Password:1308000936
;; Signature:ASN4WxQZ7F3NHI77BpZO.40yTYXrACLrN89a7RJHuhI3K.7Cce1LVPbC
;; -------------------------------------------------------------------------
;; Base PayPal Command
;; -------------------------------------------------------------------------
(defcommand paypal (http)
((username :host local :initform (error "Please provide :username"))
(password :host local :initform (error "Please provide :password"))
(signature :host local :initform (error "Please provide :signature"))
(api-method :host local :initform (error "Please provide :api-method")))
(:default-initargs :url "https://api-3t.sandbox.paypal.com/nvp"
:username "seller_1308000922_biz_api1.core.gen.tr"
:password "1308000936"
:signature "ASN4WxQZ7F3NHI77BpZO.40yTYXrACLrN89a7RJHuhI3K.7Cce1LVPbC"
:method 'post))
(defmethod paypal.add-parameter ((self paypal) key val)
(setf (s-v 'post-data)
(concatenate 'string (s-v 'post-data)
(format nil "~A=~A&" (escape-as-uri key)
(escape-as-uri val)))))
(defmethod paypal.add-parameter ((self paypal) key (val symbol))
(paypal.add-parameter self key (symbol-name val)))
(defmethod paypal.add-parameter ((self paypal) key (val integer))
(paypal.add-parameter self key (format nil "~D" val)))
;; 100.00
(defmethod paypal.to-currency ((self paypal) amount)
(format nil "~,2,,F" amount))
;; 2011-07-05T01:26:40Z
(defmethod paypal.to-date ((self paypal) timestamp)
(multiple-value-bind
(second minute hour day month year day-of-week dst-p timezone)
(decode-universal-time timestamp)
(declare (ignore timezone dst-p day-of-week))
(format nil "~a-~2,'0d-~2,'0dT~2,'0d:~,'0d:~2,'0dZ"
year month day hour minute second)))
(defmethod run ((self paypal))
(paypal.add-parameter self "USER" (s-v 'username))
(paypal.add-parameter self "PWD" (s-v 'password))
(paypal.add-parameter self "SIGNATURE" (s-v 'signature))
(paypal.add-parameter self "VERSION" "74.0")
(paypal.add-parameter self "METHOD" (s-v 'api-method))
(let* ((result (call-next-method))
(result (aif (slot-value result 'entities)
(uri.queries
(uri? (make-core-stream
(format nil "/foo.core?~A"
(octets-to-string (car it) :utf-8)))))
(error "Could not parse PayPal Http result"))))
result))
;; -------------------------------------------------------------------------
;; Set Express Checkout
;; -------------------------------------------------------------------------
;; API:
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout
(defcommand paypal-set-express-checkout (paypal)
((amount :host local :initform (error "Please provide :amount"))
(return-url :host local
:initform "http://www.coretal.net/sales.html?page:success")
(cancel-url :host local
:initform "http://www.coretal.net/sales.html?page:cancel")
(action :host local :initform "Sale"))
(:default-initargs :api-method "SetExpressCheckout"))
(defmethod run ((self paypal-set-express-checkout))
(with-slots (amount return-url cancel-url action) self
(paypal.add-parameter self "PAYMENTREQUEST_0_AMT"
(paypal.to-currency self amount))
(paypal.add-parameter self "RETURNURL" return-url)
(paypal.add-parameter self "CANCELURL" cancel-url)
(paypal.add-parameter self "PAYMENTREQUEST_0_PAYMENTACTION" action))
(call-next-method self))
;; SERVER> (paypal-set-express-checkout :amount 10)
;; (("TOKEN" . "EC-3XS050383E9627310")
;; ("TIMESTAMP" . "2011-07-04T23:19:48Z")
;; ("CORRELATIONID" . "47bce484e6e64")
;; ("ACK" . "Success")
;; ("VERSION" . "74.0")
;; ("BUILD" . "1936884"))
;; After SetExpressCheckout, redirect to:
;; https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-3XS050383E9627310
;; Returns back to:
;; http://www.coretal.net/sales.html?page:success&token=EC-3XS050383E9627310&PayerID=FK6S5PJBHZ6JJ
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetExpressCheckoutDetails
(defcommand paypal-get-express-checkout-details (paypal)
((token :host local :initform (error "Please provide :token")))
(:default-initargs :api-method "GetExpressCheckoutDetails"))
(defmethod run ((self paypal-get-express-checkout-details))
(paypal.add-parameter self "TOKEN" (s-v 'token))
(call-next-method self))
;; SERVER> (paypal-get-express-checkout-details
;; :token "EC-3XS050383E9627310")
;; (("TOKEN" . "EC-3XS050383E9627310")
;; ("CHECKOUTSTATUS" . "PaymentActionNotInitiated")
;; ("TIMESTAMP" . "2011-07-04T23:50:04Z")
;; ("CORRELATIONID" . "ce875ca9b0e12")
;; ("ACK" . "Success")
;; ("VERSION" . "74.0")
;; ("BUILD" . "1936884")
;; ("EMAIL" . "[email protected]")
;; ("PAYERID" . "FK6S5PJBHZ6JJ")
;; ("PAYERSTATUS" . "verified")
;; ("FIRSTNAME" . "Test")
;; ("LASTNAME" . "User")
;; ("COUNTRYCODE" . "US")
;; ("SHIPTONAME" . "Test User")
;; ("SHIPTOSTREET" . "1 Main St")
;; ("SHIPTOCITY" . "San Jose")
;; ("SHIPTOSTATE" . "CA")
;; ("SHIPTOZIP" . "95131")
;; ("SHIPTOCOUNTRYCODE" . "US")
;; ("SHIPTOCOUNTRYNAME" . "United States")
;; ("ADDRESSSTATUS" . "Confirmed")
;; ("CURRENCYCODE" . "USD")
;; ("AMT" . "10.00")
;; ("SHIPPINGAMT" . "0.00")
;; ("HANDLINGAMT" . "0.00")
;; ("TAXAMT" . "0.00")
;; ("INSURANCEAMT" . "0.00")
;; ("SHIPDISCAMT" . "0.00")
;; ("PAYMENTREQUEST_0_CURRENCYCODE" . "USD")
;; ("PAYMENTREQUEST_0_AMT" . "10.00")
;; ("PAYMENTREQUEST_0_SHIPPINGAMT" . "0.00")
;; ("PAYMENTREQUEST_0_HANDLINGAMT" . "0.00")
;; ("PAYMENTREQUEST_0_TAXAMT" . "0.00")
;; ("PAYMENTREQUEST_0_INSURANCEAMT" . "0.00")
;; ("PAYMENTREQUEST_0_SHIPDISCAMT" . "0.00")
;; ("PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED" . "false")
;; ("PAYMENTREQUEST_0_SHIPTONAME" . "Test User")
;; ("PAYMENTREQUEST_0_SHIPTOSTREET" . "1 Main St")
;; ("PAYMENTREQUEST_0_SHIPTOCITY" . "San Jose")
;; ("PAYMENTREQUEST_0_SHIPTOSTATE" . "CA")
;; ("PAYMENTREQUEST_0_SHIPTOZIP" . "95131")
;; ("PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE" . "US")
;; ("PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME" . "United States")
;; ("PAYMENTREQUESTINFO_0_ERRORCODE" . "0"))
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoExpressCheckoutPayment
(defcommand paypal-do-express-checkout-payment (paypal)
((token :host local :initform (error "Please provide :token"))
(payer-id :host local :initform (error "Please provide :payer-id"))
(amount :host local :initform (error "Please provide :amount"))
(currency :host local :initform "USD")
(action :host local :initform "Sale")
(fraud-filter-details :host local :initform t))
(:defualt-initargs :api-method "DoExpressCheckoutPayment"))
(defmethod run ((self paypal-do-express-checkout-payment))
(with-slots (token amount currency payer-id action) self
(paypal.add-parameter self "TOKEN" token)
(paypal.add-parameter self "PAYMENTREQUEST_0_AMT"
(paypal.to-currency self amount))
(paypal.add-parameter self "PAYMENTREQUEST_0_CURRENCYCODE" currency)
(paypal.add-parameter self "PAYERID" (s-v 'payer-id))
(paypal.add-parameter self "PAYMENTREQUEST_0_PAYMENTACTION" action))
(if (s-v 'fraud-filter-details)
(paypal.add-parameter self "RETURNFMFDETAILS" "1"))
(call-next-method self))
;; SERVER> (paypal-do-express-checkout-payment
;; :token "EC-3XS050383E9627310"
;; :payer-id "FK6S5PJBHZ6JJ"
;; :amount 10)
;; (("TOKEN" . "EC-3XS050383E9627310")
;; ("SUCCESSPAGEREDIRECTREQUESTED" . "false")
;; ("TIMESTAMP" . "2011-07-05T01:26:40Z")
;; ("CORRELATIONID" . "a3d8df9d3aa60")
;; ("ACK" . "Success")
;; ("VERSION" . "74.0")
;; ("BUILD" . "1936884")
;; ("INSURANCEOPTIONSELECTED" . "false")
;; ("SHIPPINGOPTIONISDEFAULT" . "false")
;; ("PAYMENTINFO_0_TRANSACTIONID" . "92W25351B27670106")
;; ("PAYMENTINFO_0_TRANSACTIONTYPE" . "expresscheckout")
;; ("PAYMENTINFO_0_PAYMENTTYPE" . "instant")
;; ("PAYMENTINFO_0_ORDERTIME" . "2011-07-05T01:26:38Z")
;; ("PAYMENTINFO_0_AMT" . "10.00")
;; ("PAYMENTINFO_0_FEEAMT" . "0.59")
;; ("PAYMENTINFO_0_TAXAMT" . "0.00")
;; ("PAYMENTINFO_0_CURRENCYCODE" . "USD")
;; ("PAYMENTINFO_0_PAYMENTSTATUS" . "Completed")
;; ("PAYMENTINFO_0_PENDINGREASON" . "None")
;; ("PAYMENTINFO_0_REASONCODE" . "None")
;; ("PAYMENTINFO_0_PROTECTIONELIGIBILITY" . "Eligible")
;; ("PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE" . "ItemNotReceivedEligible,UnauthorizedPaymentEligible")
;; ("PAYMENTINFO_0_SECUREMERCHANTACCOUNTID" . "44RZP6LPAMSQL")
;; ("PAYMENTINFO_0_ERRORCODE" . "0")
;; ("PAYMENTINFO_0_ACK" . "Success"))
;; +-------------------------------------------------------------------------
;; | Recurring Payments
;; +-------------------------------------------------------------------------
;; Documentation:
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECRecurringPayments
;; API:
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout
;; -------------------------------------------------------------------------
;; Paypal Recurring Set Checkout
;; -------------------------------------------------------------------------
(defcommand paypal-recurring-set-express-checkout (paypal)
((return-url :host local
:initform "http://www.coretal.net/sales.html?page:success")
(cancel-url :host local
:initform "http://www.coretal.net/sales.html?page:cancel")
(description :host local :initform (error "Provide :description"))
(max-amount :host local :initform 25))
(:default-initargs :api-method "SetExpressCheckout"))
(defmethod run ((self paypal-recurring-set-express-checkout))
(with-slots (return-url cancel-url description max-amount) self
(paypal.add-parameter self "RETURNURL" return-url)
(paypal.add-parameter self "CANCELURL" cancel-url)
(paypal.add-parameter self "L_BILLINGTYPE0" "RecurringPayments")
(paypal.add-parameter self "L_BILLINGAGREEMENTDESCRIPTION0" description)
(paypal.add-parameter self "MAXAMT" (paypal.to-currency self max-amount))
(paypal.add-parameter self "AMT" (paypal.to-currency self 0)))
(call-next-method self))
;; -------------------------------------------------------------------------
;; Paypal Create Recurring Payments Profile
;; -------------------------------------------------------------------------
(defvar +paypal-billing-period+ '("Month" "Day" "Week" "SemiMonth" "Year"))
;; API:
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_CreateRecurringPayments
(defcommand paypal-create-recurring-payments-profile (paypal)
((token :host local :initform (error "Please provide :token"))
(amount :host local :initform (error "Please provide :amount"))
(description :host local :initform (error "Please provide :description"))
(start-date :host local :initform (get-universal-time))
(currency :host local :initform "USD")
(billing-period :host local :initform (car +paypal-billing-period+))
(billing-frequency :host local :initform 1)
(trial-billing-period :host local :initform (car +paypal-billing-period+))
(trial-billing-frequency :host local :initform 1)
(trial-amount :host local :initform nil))
(:default-initargs :api-method "CreateRecurringPaymentsProfile"))
(defmethod run ((self paypal-create-recurring-payments-profile))
(with-slots (token start-date billing-period
billing-frequency amount currency description) self
(paypal.add-parameter self "TOKEN" token)
(paypal.add-parameter self "PROFILESTARTDATE"
(paypal.to-date self start-date))
(paypal.add-parameter self "BILLINGPERIOD" billing-period)
(paypal.add-parameter self "BILLINGFREQUENCY" billing-frequency)
(paypal.add-parameter self "CURRENCYCODE" currency)
(paypal.add-parameter self "AMT" (paypal.to-currency self amount))
(paypal.add-parameter self "DESC" description))
(when (s-v 'trial-amount)
(with-slots (trial-billing-period trial-billing-frequency
trial-amount) self
(paypal.add-parameter self "TRIALBILLINGPERIOD" trial-billing-period)
(paypal.add-parameter self "TRIALBILLINGFREQUENCY"
trial-billing-frequency)
(paypal.add-parameter self "TRIALAMT"
(paypal.to-currency self trial-amount))))
(call-next-method self))
;; -------------------------------------------------------------------------
;; Paypal Get Recurring Payments Profile Details
;; -------------------------------------------------------------------------
;; API:
;; https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetRecurringPaymentsProfileDetails
(defcommand paypal-get-recurring-payments-profile (paypal)
((profile-id :host local :initform (error "Provide :profile-id")))
(:default-initargs :api-method "GetRecurringPaymentsProfileDetails"))
(defmethod run ((self paypal-get-recurring-payments-profile))
(paypal.add-parameter self "PROFILEID" (s-v 'profile-id))
(call-next-method self))
;; -------------------------------------------------------------------------
;; Recurring Payment Flow
;; -------------------------------------------------------------------------
;; SERVER> (paypal-recurring-set-express-checkout
;; :description "Time Magazine Subscription")
;; (("TOKEN" . "EC-3P199454L29273808")
;; ("TIMESTAMP" . "2011-07-05T21:44:01Z")
;; ("CORRELATIONID" . "9e9d2e5210f4b")
;; ("ACK" . "Success")
;; ("VERSION" . "74.0")
;; ("BUILD" . "1936884"))
;;
;; Redirect to:
;; https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=<value_from_SetExpressCheckoutResponse>&address_override=1
;; Returns back to:
;; http://www.coretal.net/sales.html?page:success&token=EC-3P199454L29273808
;; SERVER> (paypal-get-express-checkout-details
;; :token "EC-3P199454L29273808")
;; (("TOKEN" . "EC-3P199454L29273808")
;; ("BILLINGAGREEMENTACCEPTEDSTATUS" . "1")
;; ("CHECKOUTSTATUS" . "PaymentActionNotInitiated")
;; ("TIMESTAMP" . "2011-07-05T22:00:14Z")
;; ("CORRELATIONID" . "741d53f91608a")
;; ("ACK" . "Success")
;; ("VERSION" . "74.0")
;; ("BUILD" . "1936884")
;; ("EMAIL" . "[email protected]")
;; ("PAYERID" . "FK6S5PJBHZ6JJ")
;; ("PAYERSTATUS" . "verified")
;; ("FIRSTNAME" . "Test")
;; ("LASTNAME" . "User")
;; ("COUNTRYCODE" . "US")
;; ("SHIPTONAME" . "Test User")
;; ("SHIPTOSTREET" . "1 Main St")
;; ("SHIPTOCITY" . "San Jose")
;; ("SHIPTOSTATE" . "CA")
;; ("SHIPTOZIP" . "95131")
;; ("SHIPTOCOUNTRYCODE" . "US")
;; ("SHIPTOCOUNTRYNAME" . "United States")
;; ("ADDRESSSTATUS" . "Confirmed")
;; ("CURRENCYCODE" . "USD")
;; ("AMT" . "0.00")
;; ("SHIPPINGAMT" . "0.00")
;; ("HANDLINGAMT" . "0.00")
;; ("TAXAMT" . "0.00")
;; ("INSURANCEAMT" . "0.00")
;; ("SHIPDISCAMT" . "0.00")
;; ("PAYMENTREQUEST_0_CURRENCYCODE" . "USD")
;; ("PAYMENTREQUEST_0_AMT" . "0.00")
;; ("PAYMENTREQUEST_0_SHIPPINGAMT" . "0.00")
;; ("PAYMENTREQUEST_0_HANDLINGAMT" . "0.00")
;; ("PAYMENTREQUEST_0_TAXAMT" . "0.00")
;; ("PAYMENTREQUEST_0_INSURANCEAMT" . "0.00")
;; ("PAYMENTREQUEST_0_SHIPDISCAMT" . "0.00")
;; ("PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED" . "false")
;; ("PAYMENTREQUEST_0_SHIPTONAME" . "Test User")
;; ("PAYMENTREQUEST_0_SHIPTOSTREET" . "1 Main St")
;; ("PAYMENTREQUEST_0_SHIPTOCITY" . "San Jose")
;; ("PAYMENTREQUEST_0_SHIPTOSTATE" . "CA")
;; ("PAYMENTREQUEST_0_SHIPTOZIP" . "95131")
;; ("PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE" . "US")
;; ("PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME" . "United States")
;; ("PAYMENTREQUESTINFO_0_ERRORCODE" . "10001")
;; ("PAYMENTREQUESTINFO_0_SHORTMESSAGE" . "Internal Error")
;; ("PAYMENTREQUESTINFO_0_LONGMESSAGE" . "Internal Error")
;; ("PAYMENTREQUESTINFO_0_SEVERITYCODE" . "Error"))
;; SERVER> (paypal-create-recurring-payments-profile
;; :token "EC-3P199454L29273808"
;; :description "Time Magazine Subscription"
;; :amount 99)
;; (("PROFILEID" . "I-1KTXAD75YWUW")
;; ("PROFILESTATUS" . "ActiveProfile")
;; ("TIMESTAMP" . "2011-07-05T22:05:52Z")
;; ("CORRELATIONID" . "3d703d750b23")
;; ("ACK" . "Success")
;; ("VERSION" . "74.0")
;; ("BUILD" . "1907759"))
;; SERVER> (paypal-get-recurring-payments-profile
;; :profile-id "I-1KTXAD75YWUW")
;; (("PROFILEID" . "I-1KTXAD75YWUW")
;; ("STATUS" . "Active")
;; ("AUTOBILLOUTAMT" . "NoAutoBill")
;; ("DESC" . "Time Magazine Subscription")
;; ("MAXFAILEDPAYMENTS" . "0")
;; ("SUBSCRIBERNAME" . "Test User")
;; ("PROFILESTARTDATE" . "2011-07-06T07:00:00Z")
;; ("NEXTBILLINGDATE" . "2011-07-06T10:00:00Z")
;; ("NUMCYCLESCOMPLETED" . "0")
;; ("NUMCYCLESREMAINING" . "0")
;; ("OUTSTANDINGBALANCE" . "0.00")
;; ("FAILEDPAYMENTCOUNT" . "0")
;; ("TRIALAMTPAID" . "0.00")
;; ("REGULARAMTPAID" . "0.00")
;; ("AGGREGATEAMT" . "0.00")
;; ("AGGREGATEOPTIONALAMT" . "0.00")
;; ("FINALPAYMENTDUEDATE" . "1970-01-01T00:00:00Z")
;; ("TIMESTAMP" . "2011-07-05T22:17:56Z")
;; ("CORRELATIONID" . "9c5b1112c0ffe")
;; ("ACK" . "Success")
;; ("VERSION" . "74.0")
;; ("BUILD" . "1907759")
;; ("SHIPTOSTREET" . "1 Main St")
;; ("SHIPTOCITY" . "San Jose")
;; ("SHIPTOSTATE" . "CA")
;; ("SHIPTOZIP" . "95131")
;; ("SHIPTOCOUNTRYCODE" . "US")
;; ("SHIPTOCOUNTRY" . "US")
;; ("SHIPTOCOUNTRYNAME" . "United States")
;; ("SHIPADDRESSOWNER" . "PayPal")
;; ("SHIPADDRESSSTATUS" . "Unconfirmed")
;; ("BILLINGPERIOD" . "Month")
;; ("BILLINGFREQUENCY" . "1")
;; ("TOTALBILLINGCYCLES" . "0")
;; ("CURRENCYCODE" . "USD")
;; ("AMT" . "99.00")
;; ("SHIPPINGAMT" . "0.00")
;; ("TAXAMT" . "0.00")
;; ("REGULARBILLINGPERIOD" . "Month")
;; ("REGULARBILLINGFREQUENCY" . "1")
;; ("REGULARTOTALBILLINGCYCLES" . "0")
;; ("REGULARCURRENCYCODE" . "USD")
;; ("REGULARAMT" . "99.00")
;; ("REGULARSHIPPINGAMT" . "0.00")
;; ("REGULARTAXAMT" . "0.00"))
;; -------------------------------------------------------------------------
;; IPN Request
;; -------------------------------------------------------------------------
;; POST /ipn.core HTTP/1.0
;; Content-Type: application/x-www-form-urlencoded
;; Host: aycan.dyndns.org
;; Content-Length: 846
;; test_ipn=1&payment_type=instant&payment_date=03%3A58%3A43+Jul+06%2C+2011+PDT&payment_status=Completed&address_status=confirmed&payer_status=unverified&first_name=John&last_name=Smith&payer_email=buyer%40paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John+Smith&address_country=United+States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San+Jose&address_street=123%2C+any+street&receiver_email=seller%40paypalsandbox.com&receiver_id=TESTSELLERID1&residence_country=US&item_name1=something&item_number1=AK-1234&quantity1=1&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross_1=9.34&mc_handling=2.06&mc_handling1=1.67&mc_shipping=3.02&mc_shipping1=1.02&txn_type=cart&txn_id=43761058¬ify_version=2.4&custom=xyz123&invoice=abc1234&charset=windows-1252&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AXgz8rE83b1Uq60X2t2wHFjYn7xj | 19,945 | Common Lisp | .lisp | 411 | 46.291971 | 849 | 0.646213 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 4257a212f10134f883df48e731e2044f82df08f81190dcecede53b63be98e524 | 8,227 | [
-1
] |
8,228 | openid.lisp | evrim_core-server/src/clients/openid.lisp | (in-package :core-server)
;; Depreciated, Aug 2012
;; Google and fellows use OAuth 2.0 now. -evrim.
;; -------------------------------------------------------------------------
;; OpenID Funkall
;; -------------------------------------------------------------------------
;; http://openid.net/specs/openid-authentication-2_0.html
(defcommand <openid:funkall (http)
((mode :host local :initform (error "Provide :mode")))
(:default-initargs :url
"https://www.google.com/accounts/o8/ud"
;; "http://localhost:9000/accounts/o8/ud"
;; :debug t
:method 'post))
(defparser parse-openid-key-value? (c (key (make-accumulator))
(value (make-accumulator))
lst)
(:oom (:oom (:not #\:) (:type visible-char? c) (:collect c key))
(:oom (:type visible-char? c) (:collect c value))
(:do (setq lst (cons (cons key value) lst)
key (make-accumulator)
value (make-accumulator)))
(:lwsp?))
(:return (cons (cons "timestamp" (get-universal-time)) (nreverse lst))))
(defmethod %%encode ((self <openid:funkall) params)
(flet ((one (stream key-value)
(destructuring-bind (key . value) key-value
(string! stream key)
(char! stream #\:)
(string! stream value)
(char! stream #\Newline))))
(let* ((zipped params))
(with-core-stream (s "")
(reduce #'one (cdr zipped) :initial-value (one s (car zipped)))
(return-stream s)))))
(defmethod %%decode-base64 ((self <openid:funkall) str)
(base64? (make-core-stream str)))
(defmethod run ((self <openid:funkall))
(http.add-post self "openid.ns" "http://specs.openid.net/auth/2.0")
(http.add-post self "openid.mode" (s-v 'mode))
(parse-openid-key-value? (make-core-stream (call-next-method self))))
;; -------------------------------------------------------------------------
;; OpenID Associate
;; -------------------------------------------------------------------------
(defcommand <openid:associate (<openid:funkall)
((type :host local :initform "HMAC-SHA256")
(session-type :host local :initform "no-encryption"))
(:default-initargs :mode "associate"))
(defmethod run ((self <openid:associate))
(http.add-post self "openid.assoc_type" (s-v 'type))
(http.add-post self "openid.session_type" (s-v 'session-type))
(call-next-method self))
;; -------------------------------------------------------------------------
;; OpenID Request Authentication
;; -------------------------------------------------------------------------
(defcommand <openid:request-authentication (<openid:funkall)
((association :host local :initform (error "Provide :association"))
(return-to :host local :initform (error "Provide :return-to")))
(:default-initargs :mode "checkid_setup" ;; or "checkid_immediate"
))
(defmethod run ((self <openid:request-authentication))
(http.add-post self "openid.ns" "http://specs.openid.net/auth/2.0")
(http.add-post self "openid.mode" (s-v 'mode))
(http.add-post self "openid.assoc_handle"
(cdr (assoc "assoc_handle" (s-v 'association)
:test #'equal)))
(http.add-post self "openid.claimed_id"
"http://specs.openid.net/auth/2.0/identifier_select")
(http.add-post self "openid.identity"
"http://specs.openid.net/auth/2.0/identifier_select")
(http.add-post self "openid.return_to" (s-v 'return-to))
(format nil "~A?~A" (uri->string (s-v 'url)) (s-v 'post-data)))
;; -------------------------------------------------------------------------
;; OpenID Verify Authentication
;; -------------------------------------------------------------------------
(defcommand <openid:verify-authentication (<openid:funkall)
((association :host local :initform (error "Provide :association")))
(:default-initargs :url (error "Provide result :url")
:mode "verify"))
(defparser comma-seperated? (c (token (make-accumulator)) lst)
(:oom (:oom (:not #\,) (:type visible-char? c) (:collect c token))
(:do (setq lst (cons token lst) token (make-accumulator))))
(:return (nreverse lst)))
(defmethod run ((self <openid:verify-authentication))
(with-slots (url) self
(assert (equal (uri.query url "openid.assoc_handle")
(cdr (assoc "assoc_handle" (s-v 'association)
:test #'equal)))
nil "Associations are not the same: ~A ~A"
(uri.query url "openid.assoc_handle")
(cdr (assoc "assoc_handle" (s-v 'association) :test #'equal)))
(cond
((not (equal "id_res" (uri.query url "openid.mode")))
(warn "Openid Mode is different than id_res mode:~A "
(uri.query url "openid.mode"))
nil)
(t
(let* ((signed-keys (comma-seperated?
(make-core-stream
(uri.query url "openid.signed"))))
(signed-values (mapcar
(lambda (a)
(uri.query url (format nil "openid.~A" a)))
signed-keys))
(str (%%encode self (mapcar #'cons signed-keys signed-values)))
(key (%%decode-base64 self
(cdr (assoc "mac_key" (s-v 'association)
:test #'equal))))
(type (let ((type (cdr (assoc "assoc_type" (s-v 'association)
:test #'equal))))
(cond
((equal type "HMAC-SHA256") :sha256)
(t :sha1)))))
(when (s-v 'debug)
(describe (list 'signed-keys signed-keys))
(describe (list 'signed-values signed-values))
(format t "str-to-sign:~%~A~%" str)
(describe (list 'mac-key key))
(describe (list 'mac-type type))
(describe (list 'hmac-result (hmac key str type)))
(describe (list 'signature
(%%decode-base64 self
(uri.query url "openid.sig")))))
(if (equal (hmac key str type)
(crypto:byte-array-to-hex-string
(%%decode-base64 self (uri.query url "openid.sig"))))
t
nil))))))
| 5,702 | Common Lisp | .lisp | 128 | 39.757813 | 76 | 0.575976 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | c47674083e88bf0fa90035efa4a476743b6e73775b20c89e5e988b873feb5f52 | 8,228 | [
-1
] |
8,229 | facebook.lisp | evrim_core-server/src/clients/facebook.lisp | (in-package :core-server)
;; -------------------------------------------------------------------------
;; Facebook Graph HTTP Client
;; -------------------------------------------------------------------------
;; https://developers.facebook.com/docs/reference/api/
;; https://developers.facebook.com/docs/authentication/server-side/
;; https://developers.facebook.com/docs/authentication/permissions/
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2012
;;
;; 1. Pop-up a dialog using <fb:oauth-uri
;; 2. Get *code* parameter in the return-uri <not here>
;; 3. Get an access token
;; 4. Use <fb:me and fellows.
(defun make-fb-uri (&key paths queries)
(make-uri :scheme "https" :server "www.facebook.com" :paths paths :queries queries))
(defun make-fb-graph-uri (&key paths queries)
(make-uri :scheme "https" :server "graph.facebook.com" :paths paths :queries queries))
;; -------------------------------------------------------------------------
;; Oauth Dialog
;; -------------------------------------------------------------------------
;; 1. First of all, generate an OAuth Dialog URI
;; https://www.facebook.com/dialog/oauth?client-id=APP_ID&response_type=token
;; &display=popup&redirect_uri=REDIRECT_URI
;; http://node1.coretal.net:8080/auth.core?mode=return&type=facebook&code=CODE#_=_
(defun <fb:oauth-uri (&key (client-id (error "Provide :client-id"))
(redirect-uri (error "Provide :redirect-uri"))
(scope "email")
(response-type "code")
(state nil))
(let ((url (<oauth2:oauth-uri (make-fb-uri :paths '(("dialog") ("oauth")))
:client-id client-id :redirect-uri redirect-uri
:scope scope :response-type response-type
:state state)))
(setf (uri.queries url) (cons `("display" . "popup") (uri.queries url)))
url))
;; 3. Get Access Token
;; (<fb:get-access-token :client-id ".." :client-secret "..."
;; :code *code :redirect-uri *uri)
;; ((timestamp . 3187371)
;; ("access_token" . "AAACT3RIWEo0BANaEBCQDRBb.. ..glX8ZC6iZBpNue3uWRBiubZBdYMtQZDZD")
;; ("expires" . "4889"))
(defcommand <fb:get-access-token (<oauth2:get-access-token)
()
(:default-initargs
:url (make-fb-graph-uri :paths '(("oauth") ("access_token")))))
;; -------------------------------------------------------------------------
;; Facebook Authorized Funkall
;; -------------------------------------------------------------------------
(defcommand <fb:authorized-funkall (<oauth2:authorized-funkall)
((meta-data :host local :initform t))
(:default-initargs :url (make-fb-graph-uri)))
(defmethod http.setup-uri ((self <fb:authorized-funkall))
(with-slots (meta-data) self
(let ((uri (call-next-method self)))
(when meta-data
(http.add-query self "metadata" "1"))
uri)))
;; -------------------------------------------------------------------------
;; Facebook Me Command
;; -------------------------------------------------------------------------
;; + Access to current user resources
;; MANAGER> (<fb:me :token *token)
;; #<JOBJECT {1004D1BA23}>
;; #<HTTP-RESPONSE (200 . OK) {10041C7D03}>
;; MANAGER> (describe *)
;; #<JOBJECT {1004D1BA23}>
;; [standard-object]
;; Slots with :INSTANCE allocation:
;; ATTRIBUTES = (:METADATA #<JOBJECT {1004D1A643}> :UPDATED_TIME
;; "2012-06-25T18:36:31+0000" :VERIFIED TRUE :LOCALE "en_US" :TIMEZONE 3
;; :EMAIL "[email protected]" :GENDER "male" :FAVORITE_ATHLETES
;; (#<JOBJECT {10041EA0C3}>) :LOCATION #<JOBJECT {10041E1D83}> :USERNAME
;; "eevrimulu" :LINK "http://www.facebook.com/eevrimulu" :LAST_NAME "Ulu"
;; :FIRST_NAME "Evrim" :NAME "Evrim Ulu" :ID "700518347")
(defcommand <fb:me (<fb:authorized-funkall)
()
(:default-initargs :url (make-fb-graph-uri :paths '(("me")))))
(defparser facebook-date-time? (year day month second hour minute gmt)
(:fixnum? year) #\- (:fixnum? month) #\- (:fixnum? day)
#\T (:fixnum? hour) #\: (:fixnum? minute) #\: (:fixnum? second)
#\+ (:fixnum? gmt)
(:return (encode-universal-time second minute hour day month year gmt)))
(defmethod http.evaluate ((self <fb:me) result response)
(let ((result (call-next-method self result response)))
(setf (get-attribute result :updated_time)
(facebook-date-time?
(make-core-stream (get-attribute result :updated_time))))
(values result response)))
;; -------------------------------------------------------------------------
;; Other Facebook Commands
;; -------------------------------------------------------------------------
(defun make-fb-me-uri (&rest paths)
(make-fb-graph-uri :paths `(("me") ,@paths)))
(eval-when (:load-toplevel :compile-toplevel :execute)
(defvar +fb-me-commands+ '(friends home feed likes movies music
books notes permissions photos albums
videos events groups checkins)))
(defmacro deffb-me-commands (lst)
(let ((lst (if (listp lst) lst (eval lst))))
`(progn
,@(mapcar
(lambda (command)
(let ((name (intern (string-upcase command) (find-package :<fb))))
`(defcommand ,name (<fb:me)
()
(:default-initargs :url (make-fb-me-uri '(,(symbol-name command)))))))
lst))))
(deffb-me-commands +fb-me-commands+)
;; one more extra, videos-uploaded.
(defcommand <fb:videos-uploaded (<fb:me)
()
(:default-initargs :url (make-fb-me-uri '("videos") '("uploaded"))))
(defcommand <fb:fetch (<fb:authorized-funkall)
((id :host local :initform (error "Provide :id") :initarg :id)))
(defmethod http.setup-uri ((self <fb:fetch))
(let ((uri (call-next-method self)))
(setf (uri.paths uri) (list (list (s-v 'id))))
uri))
(defun <fb:authenticate (token)
(let ((user (<fb:me :token token :debug-p t)))
(list :email (format nil "[email protected]"
(get-attribute user :username))
:name (get-attribute user :name))))
;; Access Token Debug Info
;; Working
;; https://graph.facebook.com:443/oauth/access_token?client%5Fid=162577700491917&client%5Fsecret=51b3bdef9fdf2e4175db9595f1fc3c89&code=AQDZYnYRBJRBz8pKc3PqsXYaXN0S5jj8tNxd%5FtwrDu5XIv0NwaJqjQV1y%5F0%5FOYcByxljiV452ukXccbikLn1%5Fw4C%2Di18goMNilQo%5Fna8U%5FhPar6ajCkHwZOyMUmo9jShB0rF9TCXQVLe0QxkWyAYtKzqLvJRg3Hy3T8vi0nMhc%2DyEU%2DmcrH2Qw8PybgKPea7pxc&redirect%5Furi=http%3A%2F%2Fnode1%2Ecoretal%2Enet%3A8080%2Fauth%2Ecore%3Faction%3Danswer%26provider%3Dfacebook%26return%2Dto%3Dhttp%253A%252F%252Flocalhost%253A8080%252Fauthentication%252Fauth%2Ecore
;; Not working
;; https://graph.facebook.com:443/oauth/access_token?client%5Fid=162577700491917&client%5Fsecret=51b3bdef9fdf2e4175db9595f1fc3c89&code=AQCbh95Dr6ciqyIx0JnU%2D4iQ%2DFf5qZ%5FatPfgqriUeAmawvTLI9%5FYxN%2D5tvsv5q7b1ENz1PATSL9W%5FVzu%5FB0WVSfoN01bCahCjPj4e%2DwU79ojKtB1Tf5O%2D8vssKdNJiz%5FnxtdTRZfx1QFMt7S1Vd2uYrX%2DwS4GV0OTumSb7YXaT6kUAeeQxOsFcpM9PoQmAUQ248&redirect%5Furi=http%253A%252F%252Fnode1%252Ecoretal%252Enet%253A8080%252Fauth%252Ecore%253Faction%253Danswer%2526provider%253Dfacebook%2526return%25252Dto%253Dhttp%25253A%25252F%25252Flocalhost%25253A8080%25252Fauthentication%25252Fauth%25252Ecore
;; https://graph.facebook.com:443/oauth/access_token?client%5Fid=162577700491917&client%5Fsecret=51b3bdef9fdf2e4175db9595f1fc3c89&code=AQC8jTg8k9exmdSQBUh0uFy%5F4kLXj9OwaUpSmPaiagTutbQngNEvYhdy6QcMRXTjWTRhSGe4cptcqzq%5F4DTG0aAAedCWJnbouROjKNwUXVFyVpA1b8B8FCDxygcWhtj2lLG2YCnqFH5ibwksI5%5F%5FLNV2rni9c8NdUgWKxpvLjiRx%5F8wFhLqk1Ra%5FEmz%5FGz6%2D4ng&redirect%5Furi=http%3A%2F%2Fnode1%2Ecoretal%2Enet%3A8080%2Fauth%2Ecore%3Faction%3Danswer%26provider%3Dfacebook%26return%252Dto%3Dhttp%253A%252F%252Flocalhost%253A8080%252Fauthentication%252Fauth%252Ecore
;; Not working
;; https://graph.facebook.com:443/oauth/access_token?client_id=162577700491917&client_secret=51b3bdef9fdf2e4175db9595f1fc3c89&code=AQBEwOjX8eOpcse-L0yuTtOj-fWJyLeNvUpc1srzTnxxbOAaoNWptww_ZxmIGPceScKlMneMJ1FHoXwIrcom3vOop5rYkG_En7pkUNvZFg3e32njPkT2mPZjv3Iv9dRAMxEXwv9DP1X3QcbCIvPMkAaL3Atx6j-qMgdCPHtISl0-LD5oYQ0Lz2luUYg4Iuvd_zs&redirect_uri=http%3A%2F%2Fnode1%2Ecoretal%2Enet%3A8080%2Fauth%2Ecore%3Faction%3Danswer%26provider%3Dfacebook%26return-to%3Dhttp%253A%252F%252Flocalhost%253A8080%252Fauthentication%252Fauth%252Ecore
;; Working
;; https://graph.facebook.com:443/oauth/access_token?client_id=162577700491917&client_secret=51b3bdef9fdf2e4175db9595f1fc3c89&code=AQAu5wxOSY-AC8DOcoD8qn5YQ1-07FPggnuAvKhAgv7qOkqse0ARiqdxxA8eyb9sO2kuCR6zlYAYrWUxCUkmns8SBlZiBJYYtu36JChBWZIVQv1ZurcrEKSG1TIsOZrxBL1OUAkxNieleAxEFf36VzXdy53cRr9GwI6dCgb9eEV-aeHZFWQXWBj1smK_RPeoER8&redirect_uri=http%3A%2F%2Fnode1.coretal.net%3A8080%2Fauth.core%3Faction%3Danswer%26provider%3Dfacebook%26return-to%3Dhttp%253A%252F%252Flocalhost%253A8080%252Fauthentication%252Fauth.core
| 8,587 | Common Lisp | .lisp | 134 | 61.41791 | 600 | 0.690437 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 4252d44560cd5c0102e48567e8e71651c3691c5f5c30301651012b45a390083f | 8,229 | [
-1
] |
8,230 | markup.lisp | evrim_core-server/src/markup/markup.lisp | (in-package :core-server)
(defclass markup ()
((tag :initarg :tag)
(namespace :initarg :namespace)
(attributes :initarg :attributes)
(children :initarg :children)))
(defun make-markup (namespace tag attributes children)
(make-instance 'markup
:namespace namespace
:tag tag
:attributes attributes
:children children))
(defun make-markup2 (symbol attributes children)
(make-instance 'markup
:namespace (package-name (symbol-package symbol))
:tag (symbol-name symbol)
:attributes attributes
:children children))
(defmacro defto-markup (((var specializer)) &body body)
(with-unique-names (k)
`(defmethod to-markup ((,var ,specializer) &optional (,k #'to-markup))
(declare (ignorable ,k))
,@body)))
(defto-markup ((object t))
(error "Could not convert ~A to markup." object))
(defto-markup ((object (eql 't)))
(make-markup2 t nil nil))
(defto-markup ((object null))
(make-markup2 'nil nil nil))
(defmethod from-markup ((markup markup) &optional (k #'from-markup))
(from-markup2 markup (intern (slot-value markup 'tag)
(find-package (slot-value markup 'namespace)))
k))
(defmacro deffrom-markup ((object specializer) &body body)
(with-unique-names (k tag)
`(defmethod from-markup2 ((,object markup) (,tag ,specializer) &optional (,k #'from-markup))
(declare (ignorable ,k))
,@body)))
(deffrom-markup (object (eql 't))
t)
(deffrom-markup (object null)
nil)
(defmacro defmarkup (name supers slots)
`(defclass+ ,name ,supers
,(mapcar (lambda (slot)
`(,slot :host attribute))
slots)))
(defmarkup html-markup (markup)
())
(defmarkup html-core-attributes ()
(class id style title))
(defmarkup html-event-attributes ()
(onclick ondblclick onmousedown onmouseup onmouseover onmousemove
onmouseout onkeypress onkeydown onkeyup))
(defmarkup html-i18n-attributes ()
(dir lang))
(defmacro defhtml-tag1 (name supers slots)
`(progn
(defmarkup ,name (,@supers html-markup)
,slots)
(defun ,name (&rest args)
(multiple-value-bind (attributes children) (tag-attributes args)
(apply #'make-instance ',name
(append attributes
(list :children (flatten children))))))))
;; ----------------------------------------------------------------------------
;; HTML Markup
;; ----------------------------------------------------------------------------
(defhtml-tag1 <:foo (html-core-attributes html-event-attributes html-i18n-attributes)
(accesskey charset coords href hreflang name onblur onfocus rel rev shape
tabindex target type))
(defhtml-tag1 <:abbr (html-core-attributes html-event-attributes html-i18n-attributes)
())
| 2,685 | Common Lisp | .lisp | 73 | 33.123288 | 96 | 0.66821 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 2143847f487dfdbbc8468cdff5bfa924bcb0754ce396954cd954363045e72f8f | 8,230 | [
-1
] |
8,231 | schema.lisp | evrim_core-server/src/markup/schema.lisp | (in-package :core-server)
;; -------------------------------------------------------------------------
;; XML Schema
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass xml-schema+ (xml+)
()
(:default-initargs
:namespace "xs"
:schema "http://www.w3.org/2001/XMLSchema")))
(defclass+ xml-schema-element (xml)
())
(defmacro defxs-tag (name &rest attributes)
`(defclass+ ,name (xml-schema-element)
(,@(mapcar (lambda (attr) (list attr :host 'remote :print t)) attributes))
(:metaclass xml-schema+)
(:tag ,@(string-downcase (symbol-name name)))
(:namespace ,@(string-downcase
(subseq (package-name (symbol-package name)) 1)))
(:attributes ,@attributes)))
(defxs-tag <xs:schema target-namespace element-form-default final-default block-default
attribute-form-default)
(defxs-tag <xs:import namespace schema-location)
(defxs-tag <xs:element name type ref)
(defxs-tag <xs:complex-type name mixed abstract)
(defxs-tag <xs:sequence)
(defxs-tag <xs:any max-occurs min-occurs namespace process-contents)
(defxs-tag <xs:any-attribute namespace process-contents)
(defxs-tag <xs:annotation)
(defxs-tag <xs:documentation)
(defxs-tag <xs:complex-content)
(defxs-tag <xs:simple-content)
(defxs-tag <xs:extension base)
(defxs-tag <xs:unique name)
(defxs-tag <xs:selector xpath)
(defxs-tag <xs:field xpath)
(defxs-tag <xs:choice min-occurs max-occurs)
(defxs-tag <xs:attribute name type use)
(defxs-tag <xs:simple-type)
(defxs-tag <xs:list item-type)
(defxs-tag <xs:union member-types)
(defxs-tag <xs:restriction base)
(defxs-tag <xs:enumeration value)
(defxs-tag <xs:attribute-group ref name)
(defxs-tag <xs:pattern value)
;; -------------------------------------------------------------------------
;; Schema -> Markup Generation
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun generate-tags-from-xml (xml package-name &optional (no-package nil))
(let ((elements (xml-search xml (lambda (a) (typep a '<xs:element))))
(tags (list)))
(mapcar (lambda (element)
(let* ((type (slot-value element 'type))
(type (aif (split ":" type)
(cadr it)
type))
(type-def (xml-search xml
(lambda (a)
(and (typep a '<xs:complex-type)
(equal (slot-value a 'name) type))))))
(cond
(type-def
(let ((attributes (xml-search type-def (lambda (a) (typep a '<xs:attribute)))))
(pushnew (list element type-def attributes) tags
:key #'car :test (lambda (a b)
(equal (slot-value a 'name)
(slot-value b 'name))))))
(t
;; (warn "type-def not found ~A" (slot-value element 'name))
nil
))))
elements)
(let* ((upper-case (string-upcase (symbol-name package-name)))
(long-name (make-keyword (format nil "TR.GEN.CORE.SERVER.~A" upper-case)))
(short-name (make-keyword (format nil "<~A" upper-case)))
(third-name (make-keyword (format nil "CORE-SERVER.~A" upper-case)))
(metaclass (intern (format nil "~A+" upper-case)))
(class (intern (format nil "~A-ELEMENT" upper-case)))
(macro-name (intern (format nil "DEF~A-TAG" upper-case)))
(namespace (slot-value xml 'target-namespace)))
(assert (not (null namespace)) nil "Target-Namespace cannot be null")
`(progn
,(when (not no-package)
`(defpackage ,long-name
(:nicknames ,short-name ,third-name)
(:export ,@(mapcar (lambda (tag)
(make-symbol (string-upcase (slot-value (car tag) 'name))))
tags))))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass ,metaclass (xml+)
()
(:default-initargs :namespace ,(symbol-to-js package-name) :schema ,namespace)))
(defclass+ ,class (xml)
())
(defmacro ,macro-name (name &rest attributes)
(let ((class-name (intern (symbol-name name) ,short-name) ))
`(progn
(defclass+ ,class-name (,',class)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass ,',metaclass)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',class-name))))
,@(mapcar (lambda (tag)
(destructuring-bind (element type-def attributes) tag
(declare (ignore type-def))
`(,macro-name ,(intern (string-upcase (slot-value element 'name)))
,@(mapcar (lambda (attribute)
(with-slots (name) attribute
(intern
(symbol-name (js->keyword name)))))
attributes))))
tags)
(register-xml-namespace ,namespace ,short-name))))))
(defmacro defxml-namespace (namespace xml-schema-pathname &optional (no-package 'nil))
(let* ((xml-schema-pathname (if (pathnamep xml-schema-pathname)
xml-schema-pathname
(eval xml-schema-pathname)))
(stream (make-xml-stream (make-core-stream xml-schema-pathname) namespace))
(xml (read-stream stream))
(no-package (eval no-package)))
(assert (not (null xml)) nil "Cannot read xml from ~A" xml-schema-pathname)
(generate-tags-from-xml xml namespace no-package)))
(eval-when (:load-toplevel :compile-toplevel :execute)
(defun make-xml-schema-pathname (name)
(pathname (format nil "~A/src/markup/~A" (bootstrap:home) name))))
;; (defxml-namespace wsdl (make-xml-schema-pathname "wsdl20.xsd"))
| 5,489 | Common Lisp | .lisp | 129 | 37.48062 | 88 | 0.622172 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 110d439297379d69a0e74e0bd8c99b4b5ac00833ada9dc7aa90688827551e273 | 8,231 | [
-1
] |
8,232 | w3c.lisp | evrim_core-server/src/markup/w3c.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :core-server)
;;+----------------------------------------------------------------------------
;;| W3C DOM Library
;;+----------------------------------------------------------------------------
;;
;; This file contains implementation of W3C DOM Standard.
;; http://www.w3.org/DOM/
;;
;; http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/ecma-script-binding.html
;;
;; Properties of the DOMException Constructor function:
;; DOMException.INDEX_SIZE_ERR
;; The value of the constant DOMException.INDEX_SIZE_ERR is 1.
;; DOMException.DOMSTRING_SIZE_ERR
;; The value of the constant DOMException.DOMSTRING_SIZE_ERR is 2.
;; DOMException.HIERARCHY_REQUEST_ERR
;; The value of the constant DOMException.HIERARCHY_REQUEST_ERR is 3.
;; DOMException.WRONG_DOCUMENT_ERR
;; The value of the constant DOMException.WRONG_DOCUMENT_ERR is 4.
;; DOMException.INVALID_CHARACTER_ERR
;; The value of the constant DOMException.INVALID_CHARACTER_ERR is 5.
;; DOMException.NO_DATA_ALLOWED_ERR
;; The value of the constant DOMException.NO_DATA_ALLOWED_ERR is 6.
;; DOMException.NO_MODIFICATION_ALLOWED_ERR
;; The value of the constant DOMException.NO_MODIFICATION_ALLOWED_ERR is 7.
;; DOMException.NOT_FOUND_ERR
;; The value of the constant DOMException.NOT_FOUND_ERR is 8.
;; DOMException.NOT_SUPPORTED_ERR
;; The value of the constant DOMException.NOT_SUPPORTED_ERR is 9.
;; DOMException.INUSE_ATTRIBUTE_ERR
;; The value of the constant DOMException.INUSE_ATTRIBUTE_ERR is 10.
;; DOMException.INVALID_STATE_ERR
;; The value of the constant DOMException.INVALID_STATE_ERR is 11.
;; DOMException.SYNTAX_ERR
;; The value of the constant DOMException.SYNTAX_ERR is 12.
;; DOMException.INVALID_MODIFICATION_ERR
;; The value of the constant DOMException.INVALID_MODIFICATION_ERR is 13.
;; DOMException.NAMESPACE_ERR
;; The value of the constant DOMException.NAMESPACE_ERR is 14.
;; DOMException.INVALID_ACCESS_ERR
;; The value of the constant DOMException.INVALID_ACCESS_ERR is 15.
;; DOMException.VALIDATION_ERR
;; The value of the constant DOMException.VALIDATION_ERR is 16.
;; DOMException.TYPE_MISMATCH_ERR
;; The value of the constant DOMException.TYPE_MISMATCH_ERR is 17.
;;
(defvar *dom-exceptions*
'((1 . INDEX_SIZE_ERR)
(2 . DOMSTRING_SIZE_ERR)
(3 . HIERARCHY_REQUEST_ERR)
(4 . WRONG_DOCUmENT_ERR)
(5 . INVALID_CHARACTER_ERR)
(6 . NO_DATA_ALLOWED_ERR)
(7 . NO_mODIFICATION_ALLOWED_ERR)
(8 . NOT_FOUND_ERR)
(9 . NOT_SUPPORTED_ERR)
(10 . INUSE_ATTRIBUTE_ERR)
(11 . INVALID_STATE_ERR)
(12 . SYNTAX_ERR)
(13 . INVALID_mODIFICATION_ERR)
(14 . NAmESPACE_ERR)
(15 . INVALID_ACCESS_ERR)
(16 . VALIDATION_ERR)
(17 . TYPE_mISmATCH_ERR)))
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMException interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the DOMException interface:
;; code
;; This property is a Number.
(defclass *d-o-m-exception ()
((code :type integer :accessor code :initarg :code :initform 0)))
;;-----------------------------------------------------------------------------
;; Objects that implement the NodeList interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the NodeList interface:
;; length
;; This read-only property is a Number.
;; Functions of objects that implement the NodeList interface:
;; item(index)
;; This function returns an object that implements the Node interface.
;; The index parameter is a Number.
;; Note: This object can also be dereferenced using square
;; bracket notation (e.g. obj[1]). Dereferencing with an
;; integer index is equivalent to invoking the item
;; function with that index.
(defun item (list index)
(nth index list))
;;-----------------------------------------------------------------------------
;; Objects that implement the NamedNodeMap interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the NamedNodeMap interface:
;; length
;; This read-only property is a Number.
;;
;; Functions of objects that implement the NamedNodeMap interface:
;; getNamedItem(name)
;; This function returns an object that implements the Node interface.
;; The name parameter is a String.
;; setNamedItem(arg)
;; This function returns an object that implements the Node interface.
;; The arg parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
;; removeNamedItem(name)
;; This function returns an object that implements the Node interface.
;; The name parameter is a String.
;; This function can raise an object that implements the DOMException interface.
;; item(index)
;; This function returns an object that implements the Node interface.
;; The index parameter is a Number.
;; Note: This object can also be dereferenced using square
;; bracket notation (e.g. obj[1]). Dereferencing with an
;; integer index is equivalent to invoking the item
;; function with that index.
;; getNamedItemNS(namespaceURI, localName)
;; This function returns an object that implements the Node interface.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
;; setNamedItemNS(arg)
;; This function returns an object that implements the Node interface.
;; The arg parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
;; removeNamedItemNS(namespaceURI, localName)
;; This function returns an object that implements the Node interface.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
;;-----------------------------------------------------------------------------
;; Objects that implement the CharacterData interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the CharacterData interface have all
;; properties and functions of the Node interface as well as the
;; properties and functions defined below.
;;
;; Properties of objects that implement the CharacterData interface:
;; data
;; This property is a String, can raise an object that
;; implements the DOMException interface on setting and
;; can raise an object that implements the DOMException
;; interface on retrieval.
;; length
;; This read-only property is a Number.
;;
;; Functions of objects that implement the CharacterData interface:
;; substringData(offset, count)
;; This function returns a String.
;; The offset parameter is a Number.
;; The count parameter is a Number.
;; This function can raise an object that implements the DOMException interface.
;; appendData(arg)
;; This function has no return value.
;; The arg parameter is a String.
;; This function can raise an object that implements the DOMException interface.
;; insertData(offset, arg)
;; This function has no return value.
;; The offset parameter is a Number.
;; The arg parameter is a String.
;; This function can raise an object that implements the DOMException interface.
;; deleteData(offset, count)
;; This function has no return value.
;; The offset parameter is a Number.
;; The count parameter is a Number.
;; This function can raise an object that implements the DOMException interface.
;; replaceData(offset, count, arg)
;; This function has no return value.
;; The offset parameter is a Number.
;; The count parameter is a Number.
;; The arg parameter is a String.
;; This function can raise an object that implements the DOMException interface.
;; Properties of the Node Constructor function:
;; Node.ELEMENT_NODE
;; The value of the constant Node.ELEMENT_NODE is 1.
;; Node.ATTRIBUTE_NODE
;; The value of the constant Node.ATTRIBUTE_NODE is 2.
;; Node.TEXT_NODE
;; The value of the constant Node.TEXT_NODE is 3.
;; Node.CDATA_SECTION_NODE
;; The value of the constant Node.CDATA_SECTION_NODE is 4.
;; Node.ENTITY_REFERENCE_NODE
;; The value of the constant Node.ENTITY_REFERENCE_NODE is 5.
;; Node.ENTITY_NODE
;; The value of the constant Node.ENTITY_NODE is 6.
;; Node.PROCESSING_INSTRUCTION_NODE
;; The value of the constant Node.PROCESSING_INSTRUCTION_NODE is 7.
;; Node.COMMENT_NODE
;; The value of the constant Node.COMMENT_NODE is 8.
;; Node.DOCUMENT_NODE
;; The value of the constant Node.DOCUMENT_NODE is 9.
;; Node.DOCUMENT_TYPE_NODE
;; The value of the constant Node.DOCUMENT_TYPE_NODE is 10.
;; Node.DOCUMENT_FRAGMENT_NODE
;; The value of the constant Node.DOCUMENT_FRAGMENT_NODE is 11.
;; Node.NOTATION_NODE
;; The value of the constant Node.NOTATION_NODE is 12.
;; Node.DOCUMENT_POSITION_DISCONNECTED
;; The value of the constant Node.DOCUMENT_POSITION_DISCONNECTED is 0x01.
;; Node.DOCUMENT_POSITION_PRECEDING
;; The value of the constant Node.DOCUMENT_POSITION_PRECEDING is 0x02.
;; Node.DOCUMENT_POSITION_FOLLOWING
;; The value of the constant Node.DOCUMENT_POSITION_FOLLOWING is 0x04.
;; Node.DOCUMENT_POSITION_CONTAINS
;; The value of the constant Node.DOCUMENT_POSITION_CONTAINS is 0x08.
;; Node.DOCUMENT_POSITION_CONTAINED_BY
;; The value of the constant Node.DOCUMENT_POSITION_CONTAINED_BY is 0x10.
;; Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
;; The value of the constant Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC is 0x20.
;;-----------------------------------------------------------------------------
;; Objects that implement the Node interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the Node interface:
;; nodeName
;; This read-only property is a String.
;; nodeValue
;; This property is a String, can raise an object that
;; implements the DOMException interface on setting and
;; can raise an object that implements the DOMException
;; interface on retrieval.
;; nodeType
;; This read-only property is a Number.
;; parentNode
;; This read-only property is an object that implements the Node interface.
;; childNodes
;; This read-only property is an object that implements the NodeList interface.
;; firstChild
;; This read-only property is an object that implements the Node interface.
;; lastChild
;; This read-only property is an object that implements the Node interface.
;; previousSibling
;; This read-only property is an object that implements the Node interface.
;; nextSibling
;; This read-only property is an object that implements the Node interface.
;; attributes
;; This read-only property is an object that implements the NamedNodeMap interface.
;; ownerDocument
;; This read-only property is an object that implements the Document interface.
;; namespaceURI
;; This read-only property is a String.
;; prefix
;; This property is a String and can raise an object that
;; implements the DOMException interface on setting.
;; localName
;; This read-only property is a String.
;; baseURI
;; This read-only property is a String.
;; textContent
;; This property is a String, can raise an object that
;; implements the DOMException interface on setting and
;; can raise an object that implements the DOMException
;; interface on retrieval.
(defclass *node ()
((node-name :reader node-name :type string)
(node-value :accessor node-value :type string)
(node-type :reader node-type :type integer)
(parent-node :reader parent-node :type *node)
(child-nodes :reader child-nodes :type list)
(first-child :reader first-child :type *node)
(last-child :reader last-child :type *node)
(previous-sibling :reader previous-sibling :type *node)
(next-sibling :reader next-sibling :type *node)
(attributes :reader attributes :type *named-node-map)
(owner-document :reader owner-document :type *document)
(namespace-u-r-i :reader namespace-u-r-i :type string)
(prefix :accessor prefix :type string)
(local-name :reader local-name :type string)
(base-u-r-i :reader base-u-r-i :type string)
(text-content :accessor text-content :type string)))
;; Functions of objects that implement the Node interface:
;; insertBefore(newChild, refChild)
;; This function returns an object that implements the Node interface.
;; The newChild parameter is an object that implements the Node interface.
;; The refChild parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod insert-before ((node *node) (new-child *node) (ref-child *node))
)
;; replaceChild(newChild, oldChild)
;; This function returns an object that implements the Node interface.
;; The newChild parameter is an object that implements the Node interface.
;; The oldChild parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod replace-child ((node *node) (new-child *node) (ref-child *node))
)
;; removeChild(oldChild)
;; This function returns an object that implements the Node interface.
;; The oldChild parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod remove-child ((node *node) (old-child *node))
)
;; appendChild(newChild)
;; This function returns an object that implements the Node interface.
;; The newChild parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod append-child ((node *node) (new-child *node))
)
;; hasChildNodes()
;; This function returns a Boolean.
(defmethod has-child-nodes ((node *node))
)
;; cloneNode(deep)
;; This function returns an object that implements the Node interface.
;; The deep parameter is a Boolean.
(defmethod clone-node ((node *node) (deep boolean))
)
;; normalize()
;; This function has no return value.
(defmethod normalize ((node *node))
)
;; isSupported(feature, version)
;; This function returns a Boolean.
;; The feature parameter is a String.
;; The version parameter is a String.
(defmethod is-supported ((node *node) (feature string) (version string))
)
;; hasAttributes()
;; This function returns a Boolean.
(defmethod has-attributes ((node *node))
)
;; compareDocumentPosition(other)
;; This function returns a Number.
;; The other parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod compare-document-position ((node *node) (other *node))
)
;; isSameNode(other)
;; This function returns a Boolean.
;; The other parameter is an object that implements the Node interface.
(defmethod is-same-node ((node *node) (other *node))
)
;; lookupPrefix(namespaceURI)
;; This function returns a String.
;; The namespaceURI parameter is a String.
(defmethod lookup-prefix ((node *node) (namespace-u-r-i string))
)
;; isDefaultNamespace(namespaceURI)
;; This function returns a Boolean.
;; The namespaceURI parameter is a String.
(defmethod is-default-namespace ((node *node) (namespace-u-r-i string))
)
;; lookupNamespaceURI(prefix)
;; This function returns a String.
;; The prefix parameter is a String.
(defmethod lookup-namespace-u-r-i ((node *node) (prefix string))
)
;; isEqualNode(arg)
;; This function returns a Boolean.
;; The arg parameter is an object that implements the Node interface.
(defmethod is-equal-node ((node *node) (arg *node))
)
;; getFeature(feature, version)
;; This function returns an object that implements the Object interface.
;; The feature parameter is a String.
;; The version parameter is a String.
(defmethod get-feature ((node *node) (feature string) (version string))
)
;; setUserData(key, data, handler)
;; This function returns an object that implements the any type interface.
;; The key parameter is a String.
;; The data parameter is an object that implements the any type interface.
;; The handler parameter is an object that implements the UserDataHandler interface.
(defmethod set-user-data ((node *node) (key string) data handler)
)
;; getUserData(key)
;; This function returns an object that implements the any type interface.
;; The key parameter is a String.
(defmethod get-user-data ((node *node) (key string))
)
;;-----------------------------------------------------------------------------
;; Objects that implement the DocumentFragment interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the DocumentFragment interface have all
;; properties and functions of the Node interface.
(defclass *document-fragment (*node)
())
;;-----------------------------------------------------------------------------
;; Objects that implement the Document interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the Document interface have all
;; properties and functions of the Node interface as well as the
;; properties and functions defined below.
;;
;; Properties of objects that implement the Document interface:
;; doctype
;; This read-only property is an object that implements
;; the DocumentType interface.
;; implementation
;; This read-only property is an object that implements
;; the DOMImplementation interface.
;; documentElement
;; This read-only property is an object that implements
;; the Element interface.
;; inputEncoding
;; This read-only property is a String.
;; xmlEncoding
;; This read-only property is a String.
;; xmlStandalone
;; This property is a Boolean and can raise an object that
;; implements the DOMException interface on setting.
;; xmlVersion
;; This property is a String and can raise an object that
;; implements the DOMException interface on setting.
;; strictErrorChecking
;; This property is a Boolean.
;; documentURI
;; This property is a String.
;; domConfig
;; This read-only property is an object that implements
;; the DOMConfiguration interface.
(defclass *document (*node)
((doctype :reader doctype)
(implementation :reader implementation)
(document-element :reader document-element)
(input-encoding :reader input-encoding :type string)
(xml-encoding :reader xml-encoding :type string)
(xml-standalone :accessor xml-standalone :type boolean)
(xml-version :accessor xml-version :type string)
(strict-error-checking :accessor strict-error-checking :type boolean)
(document-u-r-i :accessor document-u-r-i :type string)
(dom-config :reader dom-config)))
;; Functions of objects that implement the Document interface:
;; createElement(tagName)
;; This function returns an object that implements the
;; Element interface.
;; The tagName parameter is a String.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod create-element ((self *document) (tagname string))
(make-*element :tagname tagname :parent self))
;; createDocumentFragment()
;; This function returns an object that implements the
;; DocumentFragment interface.
(defmethod create-document-fragment ((self *document))
(make-instance '*document-fragment :parent self))
;; createTextNode(data)
;; This function returns an object that implements the
;; Text interface.
;; The data parameter is a String.
(defmethod create-text-node ((self *document) (data string))
(make-instance '*text :data data))
;; createComment(data)
;; This function returns an object that implements the
;; Comment interface.
;; The data parameter is a String.
(defmethod create-comment ((self *document) (data string))
(make-instance '*comment :data data :parent self))
;; createCDATASection(data)
;; This function returns an object that implements the CDATASection interface.
;; The data parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod create-c-d-a-t-a-section ((self *document) (data string))
(make-instance '*c-d-a-t-a-section :parent self :data data))
;; createProcessingInstruction(target, data)
;; This function returns an object that implements the ProcessingInstruction interface.
;; The target parameter is a String.
;; The data parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod create-processing-instruction ((self *document)
(target string) (data string))
(error "implement me"))
;; createAttribute(name)
;; This function returns an object that implements the Attr interface.
;; The name parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod create-attribute ((self *document) (name string))
(make-instance *attr :parent self :name name))
;; createEntityReference(name)
;; This function returns an object that implements the EntityReference interface.
;; The name parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod create-entity-reference ((self *document) (name string))
(make-instance '*entity-reference :name name :parent self))
;; getElementsByTagName(tagname)
;; This function returns an object that implements the NodeList interface.
;; The tagname parameter is a String.
(defmethod get-elements-by-tag-name ((document *document) (tagname string))
(let (acc)
(core-search (list document)
#'(lambda (a)
(push a acc)
nil)
#'dom-successor
#'append)
acc))
;; importNode(importedNode, deep)
;; This function returns an object that implements the Node interface.
;; The importedNode parameter is an object that implements the Node interface.
;; The deep parameter is a Boolean.
;; This function can raise an object that implements the DOMException interface.
(defmethod import-node ((document *document)
(imported-node *node) (deep boolean))
)
;; createElementNS(namespaceURI, qualifiedName)
;; This function returns an object that implements the Element interface.
;; The namespaceURI parameter is a String.
;; The qualifiedName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod create-element-n-s ((document *document)
(namespace-u-r-i string) (qualified-name string))
)
;; createAttributeNS(namespaceURI, qualifiedName)
;; This function returns an object that implements the Attr interface.
;; The namespaceURI parameter is a String.
;; The qualifiedName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod create-attribute-n-s ((document *document)
(namespace-u-r-i string) (qualified-name string))
)
;; getElementsByTagNameNS(namespaceURI, localName)
;; This function returns an object that implements the NodeList interface.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
(defmethod get-elements-by-tag-name-n-s ((document *document)
(namespace-u-r-i string) (local-name string))
)
;; getElementById(elementId)
;; This function returns an object that implements the Element interface.
;; The elementId parameter is a String.
(defmethod get-element-by-id ((document *document) (element-id string))
)
;; adoptNode(source)
;; This function returns an object that implements the Node interface.
;; The source parameter is an object that implements the Node interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod adopt-node ((document *document) (source *node))
)
;; normalizeDocument()
;; This function has no return value.
(defmethod normalize-document ((document *document))
nil)
;; renameNode(n, namespaceURI, qualifiedName)
;; This function returns an object that implements the Node interface.
;; The n parameter is an object that implements the Node interface.
;; The namespaceURI parameter is a String.
;; The qualifiedName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod rename-node ((document *document) (n *node)
(namespace-u-r-i string) (qualified-name string))
)
;;-----------------------------------------------------------------------------
;; Objects that implement the Attr interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the Attr interface have all properties
;; and functions of the Node interface as well as the properties
;; and functions defined below.
;;
;; Properties of objects that implement the Attr interface:
;; name
;; This read-only property is a String.
;; specified
;; This read-only property is a Boolean.
;; value
;; This property is a String and can raise an object that
;; implements the DOMException interface on setting.
;; ownerElement
;; This read-only property is an object that implements
;; the Element interface.
;; schemaTypeInfo
;; This read-only property is an object that implements
;; the TypeInfo interface.
;; isId
;; This read-only property is a Boolean.
(defclass *attr (*node)
((name :reader name :type string)
(specified :reader specified :type boolean)
(value :accessor value :type string)
(owner-element :reader owner-element :type *element)
(schema-type-info :reader schema-type-info :type *type-info)
(is-id :reader is-id :type boolean)))
;;-----------------------------------------------------------------------------
;; Objects that implement the Element interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the Element interface have all
;; properties and functions of the Node interface as well as the
;; properties and functions defined below.
;;
;; Properties of objects that implement the Element interface:
;; tagName
;; This read-only property is a String.
;; schemaTypeInfo
;; This read-only property is an object that implements
;; the TypeInfo interface.
(defclass *element (*node)
((tag-name :reader tag-name :type string)
(schema-type-info :reader schema-type-info :type *type-info)))
;; Functions of objects that implement the Element interface:
;; getAttribute(name)
;; This function returns a String.
;; The name parameter is a String.
(defmethod get-attribute ((element *element) (name string))
)
;; setAttribute(name, value)
;; This function has no return value.
;; The name parameter is a String.
;; The value parameter is a String.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod set-attribute ((element *element) (name string) (value string))
)
;; removeAttribute(name)
;; This function has no return value.
;; The name parameter is a String.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod remove-attribute ((element *element) (name string))
)
;; getAttributeNode(name)
;; This function returns an object that implements the
;; Attr interface.
;; The name parameter is a String.
(defmethod get-attribute-node ((element *element) (name string))
)
;; setAttributeNode(newAttr)
;; This function returns an object that implements the
;; Attr interface.
;; The newAttr parameter is an object that implements the
;; Attr interface.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod set-attribute-node ((element *element) (new-attr *attr))
)
;; removeAttributeNode(oldAttr)
;; This function returns an object that implements the
;; Attr interface.
;; The oldAttr parameter is an object that implements the
;; Attr interface.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod remove-attribute-node ((element *element) (old-attr *attr))
)
;; getElementsByTagName(name)
;; This function returns an object that implements the
;; NodeList interface.
;; The name parameter is a String.
(defmethod get-elements-by-tag-name ((element *element) (name string))
)
;; getAttributeNS(namespaceURI, localName)
;; This function returns a String.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod get-attribute-n-s ((element *element) (namespace-u-r-i string)
(local-name string))
)
;; setAttributeNS(namespaceURI, qualifiedName, value)
;; This function has no return value.
;; The namespaceURI parameter is a String.
;; The qualifiedName parameter is a String.
;; The value parameter is a String.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod set-attribute-n-s ((element *element) (namespace-u-r-i string)
(qualified-name string) (value string))
)
;; removeAttributeNS(namespaceURI, localName)
;; This function has no return value.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; This function can raise an object that implements the
;; DOMException interface.
(defmethod remove-attribute-n-s ((element *element) (namespace-u-r-i string)
(local-name string))
)
;; getAttributeNodeNS(namespaceURI, localName)
;; This function returns an object that implements the Attr interface.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod get-attribute-node-n-s ((element *element) (namespace-u-r-i string)
(local-name string))
)
;; setAttributeNodeNS(newAttr)
;; This function returns an object that implements the Attr interface.
;; The newAttr parameter is an object that implements the Attr interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod set-attribute-node-n-s ((element *element) (new-attr *attr))
)
;; getElementsByTagNameNS(namespaceURI, localName)
;; This function returns an object that implements the NodeList interface.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod get-elements-by-tag-name-n-s ((element *element) (namespace-u-r-i string)
(local-name string))
)
;; hasAttribute(name)
;; This function returns a Boolean.
;; The name parameter is a String.
(defmethod has-attribute ((element *element) (name string))
)
;; hasAttributeNS(namespaceURI, localName)
;; This function returns a Boolean.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod has-attribute-n-s ((element *element) (namespace-u-r-i string)
(local-name string))
)
;; setIdAttribute(name, isId)
;; This function has no return value.
;; The name parameter is a String.
;; The isId parameter is a Boolean.
;; This function can raise an object that implements the DOMException interface.
(defmethod set-id-attribute ((element *element) (name string) (is-id boolean))
)
;; setIdAttributeNS(namespaceURI, localName, isId)
;; This function has no return value.
;; The namespaceURI parameter is a String.
;; The localName parameter is a String.
;; The isId parameter is a Boolean.
;; This function can raise an object that implements the DOMException interface.
(defmethod set-id-attribute-n-s ((element *element) (namespace-u-r-i string)
(local-name string) (is-id boolean))
)
;; setIdAttributeNode(idAttr, isId)
;; This function has no return value.
;; The idAttr parameter is an object that implements the Attr interface.
;; The isId parameter is a Boolean.
;; This function can raise an object that implements the DOMException interface.
(defmethod set-id-attribute-node ((element *element) (id-attr *attr) (is-id boolean))
)
;;-----------------------------------------------------------------------------
;; Objects that implement the Text interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the Text interface have all properties
;; and functions of the CharacterData interface as well as the
;; properties and functions defined below.
;;
;; Properties of objects that implement the Text interface:
;; isElementContentWhitespace
;; This read-only property is a Boolean.
;; wholeText
;; This read-only property is a String.
(defclass *text ()
((is-element-content-whitespace :reader is-element-content-whitespace :type boolean)
(whole-text :reader whole-text :type string)))
;; Functions of objects that implement the Text interface:
;; splitText(offset)
;; This function returns an object that implements the Text interface.
;; The offset parameter is a Number.
;; This function can raise an object that implements the DOMException interface.
(defmethod split-text ((text *text) (offset integer))
)
;; replaceWholeText(content)
;; This function returns an object that implements the Text interface.
;; The content parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod replace-whole-text ((text *text) (content string))
)
;;-----------------------------------------------------------------------------
;; Objects that implement the Comment interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the Comment interface have all
;; properties and functions of the CharacterData interface.
;;
(defclass *comment ()
())
;; Properties of the TypeInfo Constructor function:
;;
;; TypeInfo.DERIVATION_RESTRICTION
;; The value of the constant TypeInfo.DERIVATION_RESTRICTION is 0x00000001.
;; TypeInfo.DERIVATION_EXTENSION
;; The value of the constant TypeInfo.DERIVATION_EXTENSION is 0x00000002.
;; TypeInfo.DERIVATION_UNION
;; The value of the constant TypeInfo.DERIVATION_UNION is 0x00000004.
;; TypeInfo.DERIVATION_LIST
;; The value of the constant TypeInfo.DERIVATION_LIST is 0x00000008.
;;-----------------------------------------------------------------------------
;; Objects that implement the TypeInfo interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the TypeInfo interface:
;; typeName
;; This read-only property is a String.
;; typeNamespace
;; This read-only property is a String.
(defclass *type-info ()
((type-name :reader type-name :type string)
(type-namespace :reader type-namespace :type string)))
;; Functions of objects that implement the TypeInfo interface:
;; isDerivedFrom(typeNamespaceArg, typeNameArg, derivationMethod)
;; This function returns a Boolean.
;; The typeNamespaceArg parameter is a String.
;; The typeNameArg parameter is a String.
;; The derivationMethod parameter is a Number.
(defmethod is-derived-from ((type-info *type-info) (type-namespace-arg string)
(type-name-arg string) (derivation-method integer))
)
;; Properties of the UserDataHandler Constructor function:
;; UserDataHandler.NODE_CLONED
;; The value of the constant UserDataHandler.NODE_CLONED is 1.
(defvar *user-data-handler.*n-o-d-e_-c-l-o-n-e-d 1)
;; UserDataHandler.NODE_IMPORTED
;; The value of the constant UserDataHandler.NODE_IMPORTED is 2.
(defvar *user-data-handler.*n-o-d-e_-i-m-p-o-r-t-e-d 2)
;; UserDataHandler.NODE_DELETED
;; The value of the constant UserDataHandler.NODE_DELETED is 3.
(defvar *user-data-handler.*n-o-d-e_-d-e-l-e-t-e-d 3)
;; UserDataHandler.NODE_RENAMED
;; The value of the constant UserDataHandler.NODE_RENAMED is 4.
(defvar *user-data-handler.*n-o-d-e_-r-e-n-a-m-e-d 4)
;; UserDataHandler.NODE_ADOPTED
;; The value of the constant UserDataHandler.NODE_ADOPTED is 5.
(defvar *user-data-handler.*n-o-d-e_-a-d-o-p-t-e-d 5)
;; UserDataHandler function:
;; This function has no return value. The first parameter is a
;; Number. The second parameter is a String. The third parameter
;; is an object that implements the any type interface. The fourth
;; parameter is an object that implements the Node interface. The
;; fifth parameter is an object that implements the Node
;; interface.
;; Properties of the DOMError Constructor function:
;; DOMError.SEVERITY_WARNING
;; The value of the constant DOMError.SEVERITY_WARNING is 1.
(defvar *d-o-m-error.*s-e-v-e-r-i-t-y_-w-a-r-n-i-n-g 1)
;; DOMError.SEVERITY_ERROR
;; The value of the constant DOMError.SEVERITY_ERROR is 2.
(defvar *d-o-m-error.*s-e-v-e-r-i-t-y_-e-r-r-o-r 2)
;; DOMError.SEVERITY_FATAL_ERROR
;; The value of the constant DOMError.SEVERITY_FATAL_ERROR is 3.
(defvar *d-o-m-error.*s-e-v-e-r-i-t-y_-f-a-t-al_-e-r-r-o-r 2)
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMError interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the DOMError interface:
;; severity
;; This read-only property is a Number.
;; message
;; This read-only property is a String.
;; type
;; This read-only property is a String.
;; relatedException
;; This read-only property is an object that implements
;; the Object interface.
;; relatedData
;; This read-only property is an object that implements
;; the Object interface.
;; location
;; This read-only property is an object that implements
;; the DOMLocator interface.
(defclass *d-o-m-error ()
((severity :reader severity :type number)
(message :reader message :type string)
(type :reader %type :type string)
(related-exception :reader related-exception)
(related-data :reader related-data)
(location :reader location)))
;; DOMErrorHandler function:
;; This function returns a Boolean. The parameter is an object
;; that implements the DOMError interface.
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMLocator interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the DOMLocator interface:
;; lineNumber
;; This read-only property is a Number.
;; columnNumber
;; This read-only property is a Number.
;; byteOffset
;; This read-only property is a Number.
;; utf16Offset
;; This read-only property is a Number.
;; relatedNode
;; This read-only property is an object that implements
;; the Node interface.
;; uri
;; This read-only property is a String.
(defclass *d-o-m-locator ()
((line-number :reader line-number :type number)
(column-number :reader column-number :type number)
(byte-offset :reader byte-offset :type number)
(utf16-offset :reader utf16-offset :type number)
(related-node :reader related-node :type *node)
(uri :reader uri :type string)))
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMConfiguration interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the DOMConfiguration interface:
;; parameterNames
;; This read-only property is an object that implements the DOMStringList interface.
(defclass *d-o-m-configuration ()
((parameter-names :reader parameter-names)))
;; Functions of objects that implement the DOMConfiguration interface:
;; setParameter(name, value)
;; This function has no return value.
;; The name parameter is a String.
;; The value parameter is an object that implements the any type interface.
;; This function can raise an object that implements the DOMException interface.
(defmethod set-parameter ((dom-configuration *d-o-m-configuration)
(name string) value)
)
;; getParameter(name)
;; This function returns an object that implements the any type interface.
;; The name parameter is a String.
;; This function can raise an object that implements the DOMException interface.
(defmethod get-parameter ((dom-configuration *d-o-m-configuration) (name string))
)
;; canSetParameter(name, value)
;; This function returns a Boolean.
;; The name parameter is a String.
;; The value parameter is an object that implements the any type interface.
(defmethod can-set-parameter ((dom-configuration *d-o-m-configuration)
(name string) value)
)
;;-----------------------------------------------------------------------------
;; Objects that implement the CDATASection interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the CDATASection interface have all
;; properties and functions of the Text interface.
(defclass *c-d-a-t-a-section (*text)
())
;;-----------------------------------------------------------------------------
;; Objects that implement the DocumentType interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the DocumentType interface have all
;; properties and functions of the Node interface as well as the
;; properties and functions defined below.
;;
;; Properties of objects that implement the DocumentType interface:
;; name
;; This read-only property is a String.
;; entities
;; This read-only property is an object that implements
;; the NamedNodeMap interface.
;; notations
;; This read-only property is an object that implements
;; the NamedNodeMap interface.
;; publicId
;; This read-only property is a String.
;; systemId
;; This read-only property is a String.
;; internalSubset
;; This read-only property is a String.
(defclass *document-type (*node)
((name :reader name :type string)
(entities :reader entities)
(notation :reader notations)
(public-id :reader public-id :type string)
(system-id :reader system-id :type string)
(internal-subset :reader internal-subset :type string)))
;;-----------------------------------------------------------------------------
;; Objects that implement the Notation interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the Notation interface have all
;; properties and functions of the Node interface as well as the
;; properties and functions defined below.
;;
;; Properties of objects that implement the Notation interface:
;; publicId
;; This read-only property is a String.
;; systemId
;; This read-only property is a String.
(defclass *notation (*node)
((public-id :reader public-id :type string)
(system-id :reader system-id :type string)))
;;-----------------------------------------------------------------------------
;; Objects that implement the Entity interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the Entity interface have all properties
;; and functions of the Node interface as well as the properties
;; and functions defined below.
;;
;; Properties of objects that implement the Entity interface:
;; publicId
;; This read-only property is a String.
;; systemId
;; This read-only property is a String.
;; notationName
;; This read-only property is a String.
;; inputEncoding
;; This read-only property is a String.
;; xmlEncoding
;; This read-only property is a String.
;; xmlVersion
;; This read-only property is a String.
(defclass *entity (*node)
((public-id :reader public-id :type string)
(system-id :reader system-id :type string)
(notation-name :reader notation-name :type string)
(input-encoding :reader input-encoding :type string)
(xml-encoding :reader xml-encoding :type string)
(xml-version :reader xml-version :type string)))
;;-----------------------------------------------------------------------------
;; Objects that implement the EntityReference interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the EntityReference interface have all
;; properties and functions of the Node interface.
(defclass *entity-reference (*node)
())
;;-----------------------------------------------------------------------------
;; Objects that implement the ProcessingInstruction interface:
;;-----------------------------------------------------------------------------
;; Objects that implement the ProcessingInstruction interface have
;; all properties and functions of the Node interface as well as
;; the properties and functions defined below.
;;
;; Properties of objects that implement the ProcessingInstruction interface:
;; target
;; This read-only property is a String.
;; data
;; This property is a String and can raise an object that
;; implements the DOMException interface on setting.
(defclass *processing-instruction (*node)
((target :reader target :type string)
(data :accessor data :type string)))
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMStringList interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the DOMStringList interface:
;; length
;; This read-only property is a Number.
;; Functions of objects that implement the DOMStringList interface:
;; item(index)
;; This function returns a String.
;; The index parameter is a Number.
;; Note: This object can also be dereferenced using square
;; bracket notation (e.g. obj[1]). Dereferencing with an
;; integer index is equivalent to invoking the item
;; function with that index.
;; contains(str)
;; This function returns a Boolean.
;; The str parameter is a String.
;; TODO: Implement domstring-list (gee, what the hell w3c ppl think?)
;;-----------------------------------------------------------------------------
;; Objects that implement the NameList interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the NameList interface:
;; length
;; This read-only property is a Number.
;; Functions of objects that implement the NameList interface:
;; getName(index)
;; This function returns a String.
;; The index parameter is a Number.
;; getNamespaceURI(index)
;; This function returns a String.
;; The index parameter is a Number.
;; contains(str)
;; This function returns a Boolean.
;; The str parameter is a String.
;; containsNS(namespaceURI, name)
;; This function returns a Boolean.
;; The namespaceURI parameter is a String.
;; The name parameter is a String.
;; TODO: Implement namelist
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMImplementationList interface:
;;-----------------------------------------------------------------------------
;; Properties of objects that implement the DOMImplementationList interface:
;; length
;; This read-only property is a Number.
;; Functions of objects that implement the DOMImplementationList interface:
;; item(index)
;; This function returns an object that implements the
;; DOMImplementation interface.
;; The index parameter is a Number.
;; Note: This object can also be dereferenced using square
;; bracket notation (e.g. obj[1]). Dereferencing with an
;; integer index is equivalent to invoking the item
;; function with that index.
;; TODO: Implement domimplementationlist
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMImplementationSource interface:
;;-----------------------------------------------------------------------------
;; Functions of objects that implement the DOMImplementationSource interface:
;; getDOMImplementation(features)
;; This function returns an object that implements the
;; DOMImplementation interface.
;; The features parameter is a String.
;; getDOMImplementationList(features)
;; This function returns an object that implements the
;; DOMImplementationList interface.
;; The features parameter is a String.
;; TODO: Implement Domimplementationsource
;;-----------------------------------------------------------------------------
;; Objects that implement the DOMImplementation interface:
;;-----------------------------------------------------------------------------
;; Functions of objects that implement the DOMImplementation interface:
;; hasFeature(feature, version)
;; This function returns a Boolean.
;; The feature parameter is a String.
;; The version parameter is a String.
;; createDocumentType(qualifiedName, publicId, systemId)
;; This function returns an object that implements the DocumentType interface.
;; The qualifiedName parameter is a String.
;; The publicId parameter is a String.
;; The systemId parameter is a String.
;; This function can raise an object that implements the DOMException interface.
;; createDocument(namespaceURI, qualifiedName, doctype)
;; This function returns an object that implements the Document interface.
;; The namespaceURI parameter is a String.
;; The qualifiedName parameter is a String.
;; The doctype parameter is an object that implements the DocumentType interface.
;; This function can raise an object that implements the DOMException interface.
;; getFeature(feature, version)
;; This function returns an object that implements the Object interface.
;; The feature parameter is a String.
;; The version parameter is a String.
;; TODO: Implement domimplementaiton intirfeyz
| 56,920 | Common Lisp | .lisp | 1,108 | 49.76444 | 99 | 0.619772 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 556527fc90275f0f5ed287969eeb9e583ef0fa0006b25b098295a96ec9d10550 | 8,232 | [
-1
] |
8,233 | open-search.lisp | evrim_core-server/src/markup/open-search.lisp | ;; +-------------------------------------------------------------------------
;; | OpenSearch XML Format
;; +-------------------------------------------------------------------------
;;
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2011
;;
;; Specification:
;; http://www.opensearch.org/Specifications/OpenSearch/1.1
(in-package :core-server)
;; -------------------------------------------------------------------------
;; OpenSearch Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass open-search+ (xml+)
()
(:default-initargs
:namespace "openSearch"
:schema "http://www.opensearch.org/Specifications/OpenSearch/1.1")))
(defclass+ open-search-element (xml)
())
;; +------------------------------------------------------------------------
;; | Atom Object Definition: defatom-tag
;; +------------------------------------------------------------------------
(defmacro defopen-search-tag (name &rest attributes)
`(progn
(defclass+ ,name (open-search-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass open-search+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
(defopen-search-tag <open-search:total-results)
(defopen-search-tag <open-search:start-index)
(defopen-search-tag <open-search:items-per-page)
| 1,485 | Common Lisp | .lisp | 36 | 38.138889 | 77 | 0.475728 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 205b26e17ce9871bd4eba4d3b8d99da0a6d412e45faa7dbd74ae586be3fd2305 | 8,233 | [
-1
] |
8,234 | media.lisp | evrim_core-server/src/markup/media.lisp | ;; +-------------------------------------------------------------------------
;; | Yahoo Media RSS Markup
;; +-------------------------------------------------------------------------
;;
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2011
;;
;; Specification:
;; http://video.search.yahoo.com/mrss
;; http://code.google.com/apis/picasaweb/docs/2.0/reference.html#media_reference
(in-package :core-server)
;; -------------------------------------------------------------------------
;; Media Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass media+ (xml+)
()
(:default-initargs
:namespace "media"
:schema "http://search.yahoo.com/mrss/")))
(defclass+ media-element (xml)
())
;; +------------------------------------------------------------------------
;; | Atom Object Definition: defatom-tag
;; +------------------------------------------------------------------------
(defmacro defmedia-tag (name &rest attributes)
`(progn
(defclass+ ,name (gphoto-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass media+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
(defmedia-tag <media:group)
(defmedia-tag <media:content url file-size type medium is-default expression
bitrate framerate samplingrate channels
duration height width)
(defmedia-tag <media:rating scheme)
(defmedia-tag <media:title type)
(defmedia-tag <media:description type)
(defmedia-tag <media:keywords)
(defmedia-tag <media:thumbnail url height width time)
(defmedia-tag <media:category scheme label)
(defmedia-tag <media:hash algo)
(defmedia-tag <media:player url height width)
(defmedia-tag <media:credit role scheme)
(defmedia-tag <media:copyright url)
(defmedia-tag <media:text type lang start end)
(defmedia-tag <media:restriction relationship type)
(defmedia-tag <media:community star-rating statistics tags)
(defmedia-tag <media:comments)
(defmedia-tag <media:comment)
(defmedia-tag <media:embed url height width)
(defmedia-tag <media:responses)
(defmedia-tag <media:response)
(defmedia-tag <media:back-links)
(defmedia-tag <media:back-link)
(defmedia-tag <media:status state reason)
(defmedia-tag <media:price type info price currency)
(defmedia-tag <media:license type href)
(defmedia-tag <media:sub-title type language href)
(defmedia-tag <media:peer-link type href)
(defmedia-tag <media:location description start end)
(defmedia-tag <media:rights status)
(defmedia-tag <media:scenes)
(defmedia-tag <media:scene)
| 2,676 | Common Lisp | .lisp | 67 | 37.641791 | 80 | 0.616359 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 2cff4eff05a3bf14fb71f6d4781a84372fa5882b5e9baad12af106ad093d7c48 | 8,234 | [
-1
] |
8,235 | css.lisp | evrim_core-server/src/markup/css.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :core-server)
;;+--------------------------------------------------------------------------
;;| CSS 2 Library
;;+--------------------------------------------------------------------------
;;
;; This file contains implementation of W3C CSS 2 Standard.
;; http://www.w3.org/TR/CSS21/
;;
(defclass css-element ()
((selector :accessor css.selector :initform nil :initarg :selector)
(attributes :accessor css.attributes :initform nil :initarg :attributes)
(children :accessor css.children :initform nil :initarg :children))
(:documentation "CSS Element Base Class"))
(defmethod print-object ((self css-element) stream)
(print-unreadable-object (self stream :type t :identity t)
(format stream "~A(~D)" (css.selector self)
(length (css.children self)))))
(defvar +css-current-selector+ nil)
(defmethod write-stream ((stream xml-stream) (element css-element))
(with-slots (%stream) stream
(when +css-current-selector+
(string! %stream +css-current-selector+)
(char! %stream #\Space))
(string! %stream (css.selector element))
(string! %stream " {")
(char! %stream #\Newline)
(mapc (lambda (atom)
(if (keywordp atom)
(progn
(string! %stream (string-downcase (symbol-name atom)))
(string! %stream ": "))
(progn
(write-stream %stream atom)
(char! %stream #\;)
(char! %stream #\Newline))))
(css.attributes element))
(string! %stream "}")
(char! %stream #\Newline)
(char! %stream #\Newline)
(when (css.children element)
(let ((+css-current-selector+
(if +css-current-selector+
(format nil "~A ~A"
+css-current-selector+ (css.selector element))
(css.selector element))))
(reduce #'write-stream
(css.children element) :initial-value stream)))
stream))
(defun css (&rest args)
(multiple-value-bind (attributes children) (tag-attributes (cdr args))
(make-instance 'css-element
:selector (car args)
:attributes attributes
:children (flatten children))))
(defmethod css! ((stream core-stream) (element css-element))
(write-stream stream element))
;;+----------------------------------------------------------------------------
;;| css 2 Query via Selectors
;;+----------------------------------------------------------------------------
;; http://www.w3.org/TR/REC-CSS2/selector.html
;;
;;-----------------------------------------------------------------------------
;; 5.1 Pattern matching
;;-----------------------------------------------------------------------------
;; Pattern Meaning Described in section
;;-----------------------------------------------------------------------------
;; (defatom css-value-type ()
;; (or (alphanum? c) (eq c #.(char-code #\-))))
;; (defparser css-value? (c (acc (make-accumulator)))
;; (:oom (:type css-value-type c)
;; (:collect c acc))
;; (:return acc))
;; ;; * Matches any element.
;; (defparser css-universal-selector? ()
;; #\* (:return (cons 'universal-selector)))
;; ;; E Matches any E element (i.e., an element of type E).
;; (defparser css-type-selector? (val)
;; (:css-value? val)
;; (:return (list 'type-selector val)))
;; ;; DELETE me
;; (defparser css-selector? (val)
;; (:css-type-selector? val)
;; (:return val))
;; ;; E F Matches any F element that is a descendant of an E
;; ;; element.
;; (defparser css-descendant-selector? (a b)
;; (:css-selector? a) (:lwsp?) (:css-selector? b)
;; (:return (list 'descendant-selector a b)))
;; ;; E > F Matches any F element that is a child of an element E.
;; (defparser css-child-selector? (a b)
;; (:css-type-selector? a) (:lwsp?) #\> (:lwsp?) (:css-type-selector? b)
;; (:return (list 'child-selector a b)))
;; ;; E:first-child Matches element E when E is the first child of its
;; ;; parent.
;; (defparser css-first-child-selector? (a)
;; (:css-type-selector? a) (:sci ":first-child")
;; (:return (list 'first-child-selector a)))
;; ;; E:link Matches element E if E is the source anchor of a
;; ;; E:visited hyperlink of which the target is not yet visited
;; ;; (:link) or already visited (:visited).
;; (defparser css-link-selector? (a type)
;; (:css-type-selector? a) (:or (:and (:sci ":link") (:do (setq type 'link)))
;; (:and (:sci ":visited") (:do (setq type 'visited))))
;; (:return (list 'link-selector a type)))
;; ;; E:active Matches E during certain user actions. The dynamic
;; ;; E:hover pseudo-classes
;; ;; E:focus
;; (defparser css-dynamic-selector? (a)
;; (:css-type-selector? a)
;; (:or (:sci ":active") (:sci ":hover") (:sci ":focus"))
;; (:return (list 'dynamic-selector a)))
;; ;; E:lang(c) Matches element of type E if it is in (human) language
;; ;; c (the document language specifies how language is
;; ;; determined).
;; (defparser css-lang-selector? (a c (acc (make-accumulator)))
;; (:css-type-selector? a)
;; (:sci ":lang(")
;; (:oom (:not #\))
;; (:type octet? c)
;; (:collect c acc))
;; (:return (list 'lang-selector a acc)))
;; ;; E + F Matches any F element immediately preceded by an
;; ;; element E
;; (defparser css-adjacent-selector? (a b)
;; (:css-type-selector? a) (:lwsp?) #\+ (:lwsp?) (:css-type-selector? b)
;; (:return (list 'adjacent-selector a b)))
;; ;; E[foo] Matches any E element with the "foo" attribute set
;; ;; (whatever the value).
;; ;; E[foo="warning"] Matches any E element whose "foo" attribute value
;; ;; is exactly equal to "warning".
;; ;; E[foo~="warning"] Matches any E element whose "foo" attribute value
;; ;; is a list of space-separated values, one of which
;; ;; is exactly equal to "warning".
;; ;; E[lang|="en"] Matches any E element whose "lang" attribute has a
;; ;; hyphen-separated list of values beginning
;; ;; (from the left) with "en".
;; (defparser css-attribute-selector? (c type attrs (attr (make-accumulator))
;; operator value)
;; (:css-type-selector? type)
;; (:oom #\[
;; (:oom (:type css-value-type c)
;; (:collect c attr))
;; (:optional
;; (:or (:and #\= (:quoted? value) (:do (setq operator 'equal)))
;; (:and (:seq "~=") (:quoted? value) (:do (setq operator 'space-member)))
;; (:and (:seq "|=") (:quoted? value) (:do (setq operator 'hypen-member)))))
;; #\]
;; (:do (push (list (or operator 'exists) attr value) attrs)
;; (setf attr (make-accumulator)
;; operator nil
;; value nil)))
;; (:return (list 'attribute-selector type (nreverse attrs))))
;; ;; DIV.warning HTML only. The same as DIV[class~="warning"].
;; (defparser css-class-selector? (type class)
;; (:css-type-selector? type) #\.
;; (:css-value? class)
;; (:return (list 'attribute-selector type (list (list 'equal "class" class)))))
;; ;; E#myid Matches any E element ID equal to "myid".
;; (defparser css-id-selector? (type id)
;; (:or (:and (:css-type-selector? type) #\# (:css-value? id))
;; (:and #\# (:css-value? id) (:do (setq type "*"))))
;; (:return (list 'id-selector type id)))
;; ;; 5.2 Selector syntax
;; ;; A simple selector is either a type selector or universal selector
;; ;; followed immediately by zero or more attribute selectors, ID
;; ;; selectors, or pseudo-classes, in any order. The simple selector
;; ;; matches if all of its components match.
;; (defparser css-simple-selector? (c selectors)
;; (:or (:css-type-selector? c)
;; (:css-universal-selector? c))
;; (:do (push c selectors))
;; (:lwsp?)
;; (:zom (:or (:css-attribute-selector? c)
;; (:css-id-selector? c)
;; (:css-pseudo-selector? c))
;; (:do (push c selectors))
;; (:lwsp?))
;; (:return selectors))
;; ;; A selector is a chain of one or more simple selectors separated by
;; ;; combinators. Combinators are: whitespace, ">", and "+". Whitespace
;; ;; may appear between a combinator and the simple selectors around it.
;; (defatom css-combinator ()
;; (or (= c #.(char-code #\>))
;; (= c #.(char-code #\+))
;; (= c #.(char-code #\Space))))
;; (defparser css-selector? (a b combinator)
;; (:zom (:css-simple-selector? a)
;; (:lwsp?)
;; (:do (setq combinator #\Space))
;; (:checkpoint
;; (:or (:and #\> (:lwsp?) (:do (setq combinator #\>)))
;; (:and #\+ (:lwsp?) (:do (setq combinator #\+))))
;; (:commit))
;; (:css-simple-selector? b)))
;; The elements of the document tree that match a selector are called
;; subjects of the selector. A selector consisting of a single simple
;; selector matches any element satisfying its
;; requirements. Prepending a simple selector and combinator to a
;; chain imposes additional matching constraints, so the subjects of a
;; selector are always a subset of the elements matching the rightmost
;; simple selector.
;; One pseudo-element may be appended to the last simple selector in a
;; chain, in which case the style information applies to a subpart of
;; each subject.
;; Query DOM Structures via CSS Selectors
;; (defmethod dom.query ((element dom-element) (query string))
;; (let ((targets (css-query? query)))
;; (dom.query element targets)))
;; (defparser css? (c (selector (make-accumulator))
;; attributes
;; (acc (make-accumulator)))
;; (:lwsp?)
;; (:zom ))
;; (defmacro <:media (media &body body)
;; `(<:ah "@media " ,media " {" ~%
;; ,@body "}" ~%))
;; Test
;; (<:css ("div.abc" "div.def")
;; :def "gef"
;; :color "#000"
;; (<:css ("a:hover" "a:active" "a:link")
;; :abc "def"))
;; div.abc, dv.def {
;; def: gef;
;; color: #000;
;; };
;; div.abc a:hover, dv.def a:hover, div.abc a:active, dv.def a:active, div.abc a:link, dv.def a:link {
;; abc: def;
;; };
| 10,785 | Common Lisp | .lisp | 241 | 42.937759 | 102 | 0.584825 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 1be35435ae33f8efab039d218236467cb4b35290ca5a89c8bf9d03e17b94857b | 8,235 | [
-1
] |
8,236 | json.lisp | evrim_core-server/src/markup/json.lisp | (in-package :core-server)
;; The application/json dia Type for JavaScript Object Notation (JSON)
;; http://www.ietf.org/rfc/rfc4627.txt
;; JSon Protocol Data Types
(defrule json-string? (q c acc)
(:or (:and (:or (:seq "\"\"")
(:seq "''")) (:return "")) ;; -hek.
(:and (:quoted? q) (:return (if (> (length q) 0) q nil)))
(:or ;; (:and (:escaped-string? acc) (:return acc))
(:and (:do (setq acc (make-accumulator :byte)))
(:oom (:type (or visible-char? space?) c)
(:collect c acc))
(:return (if (> (length acc) 0)
(octets-to-string acc :utf-8)
nil))))))
(defmethod json! ((stream core-stream) (s string))
(prog1 stream (quoted! stream s #\')))
;; TODO: Implement RFC to decode numbers. -evrim
;;
;; number = [ minus ] int [ frac ] [ exp ]
;; decimal-point = %x2E ; .
;; digit1-9 = %x31-39 ; 1-9
;; e = %x65 / %x45 ; e E
;; exp = e [ minus / plus ] 1*DIGIT
;; frac = decimal-point 1*DIGIT
;; int = zero / ( digit1-9 *DIGIT)
;; minus = %x2D ; -
;; plus = %x2B ; +
;; zero = %x30 ; 0
(defrule json-number? ((sign 1) int frac exp (exp-sign 1))
(:checkpoint #\- (:do (setq sign -1)) (:commit))
(:fixnum? int)
(:checkpoint #\.
(:fixnum? frac)
(:checkpoint
#\e
(:checkpoint
(:or (:and #\- (:do (setq exp-sign -1)))
#\+)
(:commit))
(:fixnum? exp))
(:commit))
(:return int))
(defmethod json! ((stream core-stream) (n number))
(prog1 stream (fixnum! stream n)))
(defrule json-boolean? ()
(:or (:and (:seq "true") (:return 'true))
(:and (:seq "false") (:return 'false))))
(defmethod json! ((stream core-stream) (false (eql 'false)))
(string! stream "false"))
(defmethod json! ((stream core-stream) (object null))
(string! stream "null"))
(defmethod json! ((stream core-stream) (object (eql 't)))
(string! stream "true"))
(defrule json-array? (val lst)
(:lwsp?) #\[ (:lwsp?)
(:zom (:not #\])
(:json? val)
(:do (push val lst))
(:lwsp?)
(:checkpoint #\, (:commit))
(:lwsp?))
(:return (nreverse lst)))
;; FIXmE: This accepts list not array? -evrim.
(defmethod json! ((stream core-stream) (sequence sequence))
(flet ((primitive! (s p)
(prog1 s
(string! s " ,")
(char! s #\Space)
(json! s p))))
(prog1 stream
(string! stream "[ ")
(cond
((and (not (null (rest sequence))) (atom (rest sequence)))
(primitive! (json! stream (first sequence)) (rest sequence)))
(t
(reduce #'primitive! (cdr sequence)
:initial-value (json! stream (car sequence)))))
(string! stream " ]"))))
(defrule json-key? (c (acc (make-accumulator)))
(:checkpoint (:quoted? c) (:lwsp?) #\: (:return c))
(:not #\:)
(:oom (:not #\:)
(:type visible-char? c)
(:collect c acc))
(:return acc))
(defmethod json-key! ((stream core-stream) (key string))
(prog1 stream (quoted! stream key)))
(defmethod json-key! ((stream core-stream) (key symbol))
(json-key! stream (symbol-to-js key)))
(defrule json-object? (key value lst)
(:lwsp?) #\{ (:lwsp?)
(:zom (:not #\})
(:lwsp?) (:json-key? key) (:lwsp?)
(:or (:and (:seq "null") (:do (setq value nil))) ;;fixme -evrim
(:json? value)) (:lwsp?)
(:checkpoint #\, (:commit)) (:lwsp?)
(:do (setf lst (cons (list (js->keyword key) value) lst))))
(:return (apply #'jobject (flatten1 lst))))
(defmethod json! ((stream core-stream) (hash-table hash-table))
(prog1 stream
(flet ((one (key value)
(when key
(json-key! stream key)
(string! stream ": ")
(json! stream value))))
(let ((keys (hash-table-keys hash-table))
(values (hash-table-values hash-table)))
(string! stream "{ ")
(one (car keys) (car values))
(increase-indent stream)
(char! stream #\Newline)
(mapcar (lambda (k v)
(string! stream ", ")
(one k v))
(cdr keys) (cdr values))
(string! stream " }")
(decrease-indent stream)
(char! stream #\Newline)))))
(defclass jobject ()
((attributes :initarg :attributes :initform nil
:reader jobject.attributes)))
(defmacro with-attributes (attributes jobject &body body)
`(let (,@(mapcar (lambda (attr)
`(,attr (get-attribute ,jobject
,(make-keyword attr))))
attributes))
,@body))
(defun jobject (&rest attributes)
(make-instance 'jobject :attributes attributes))
(defmethod get-attribute ((self jobject) attribute)
(getf (slot-value self 'attributes) attribute))
(defmethod set-attribute ((self jobject) attribute value)
(setf (getf (slot-value self 'attributes) attribute) value))
(defmethod (setf get-attribute) (value (self jobject) attribute)
(setf (getf (slot-value self 'attributes) attribute) value))
(defun convert-label-to-javascript (label)
(let ((pos 1)
(label (string-downcase label)))
(do ((pos (search "-" label :start2 pos) (search "-" label :start2 pos)))
((null pos) (string-capitalize label))
(setf (aref label pos) #\Space))))
(defun slot->jobject (slot)
(with-slotdef (name remote-type label) slot
(cond
((string= 'password remote-type)
(jobject :name (symbol-to-js name)
;; :value ""
:type "password"
:label (or label (convert-label-to-javascript name))))
((string= 'string remote-type)
(jobject :name (symbol-to-js name)
;; :value (let ((value (slot-value object name)))
;; (typecase value
;; (symbol (symbol-to-js value))
;; (t value)))
:type "string"
:label (or label (convert-label-to-javascript name))))
(t
(jobject :name (symbol-to-js name)
;; :value (slot-value object name)
:type (symbol-to-js remote-type)
;; (typecase (slot-value object name)
;; (string "string")
;; (boolean "boolean")
;; (t (symbol-to-js remote-type)))
:label (or label (convert-label-to-javascript name)))))))
(defun class->jobject (class &optional (slots (class+.remote-slots class)))
(apply #'jobject
(reduce0 (lambda (acc slot)
(cons (make-keyword (slot-definition-name slot))
(cons (slot->jobject slot)
acc)))
slots)))
(defun object->jobject (object &optional (template-class nil))
(apply #'jobject
(append (list :core-class
(class->jobject (if template-class
(if (symbolp template-class)
(class+.find template-class)
template-class)
(class-of object))))
(reduce0 (lambda (acc slot)
(with-slotdef (name remote-type) slot
(cons (make-keyword name)
(cons (if (not (string= 'password remote-type))
(slot-value object name)) acc))))
(class+.remote-slots (or template-class (class-of object)))))))
(defun assoc->jobject (lst)
(cond
((null lst) nil)
(t
(apply #'jobject
(mapcar (lambda (a)
(cond
((listp a)
(assoc->jobject a))
((null a) nil)
(t a)))
lst)))))
(defmethod json! ((stream core-stream) (jobject jobject))
(prog1 stream
(let ((attributes (slot-value jobject 'attributes)))
(flet ((one (key value)
(when key
(char! stream #\Newline)
(json-key! stream key)
(string! stream ": ")
(json! stream value))))
(let ((keys (filter #'keywordp attributes))
(values (filter (compose #'not #'keywordp) attributes)))
(string! stream "{ ")
(increase-indent stream)
(one (car keys) (car values))
(mapcar (lambda (k v)
(string! stream ", ")
(one k v))
(cdr keys) (cdr values))
(string! stream " }")
(decrease-indent stream)
(char! stream #\Newline))))))
(defmethod json! ((stream core-stream) (object class+-instance))
(json! stream (object->jobject object)))
(defrule json? (value)
(:or (:and (:seq "undefined") (:return 'undefined))
(:and (:seq "null") (:return nil))
(:and (:or (:json-boolean? value)
(:json-number? value)
(:json-array? value)
(:json-object? value)
(:json-string? value))
(:return value))))
(defmethod json! ((stream core-stream) (undefined (eql 'undefined)))
(string! stream "undefined"))
(defmethod json! ((stream core-stream) (symbol symbol))
(string! stream (symbol-to-js symbol)))
(defmethod json! ((stream core-stream) (element xml))
(typecase element
(component (with-call/cc (component! stream element)))
(t (write-stream stream (js* (dom2js element))))))
(defmethod json! ((stream core-stream) (closure arnesi::closure/cc))
(let* ((frees (find-free-variables (slot-value closure 'code)))
(frees (filter (lambda (arg) (member (cadr arg) frees))
(slot-value closure 'arnesi::env))))
(string! stream
(js* `((lambda ,(mapcar
(lambda (arg)
(case (car arg)
(:let (cadr arg))
(t (prog1 nil
(warn "Fixme: serialize closure to json: ~A" arg)))))
frees)
(return
,(unwalk-form (slot-value closure 'arnesi::code))))
,@(mapcar (lambda (arg)
(case (car arg)
(:let (cddr arg))
(t (prog1 nil
(warn "Fixme: serialize closure to json: ~A" arg)))))
frees))))))
(defmethod json! ((stream core-stream) (uri uri))
(json! stream (uri->string uri)))
(defun json-serialize (object)
(let ((s (make-core-stream "")))
(json! s object)
(return-stream s)))
(defun json-deserialize (string)
(typecase string
(string
(let ((s (make-core-stream string)))
(json? s)))
(t
string)))
(deftrace json-parsers
'(json? json-array? json-key? json-object? json-number?
json-boolean? json-string? json-key?))
;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
| 10,220 | Common Lisp | .lisp | 288 | 31.239583 | 77 | 0.621143 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | b857f4c1768201beca81ec5907d3b1e660d2960c44a912e8bad40f9d9ee7a0a4 | 8,236 | [
-1
] |
8,237 | excerpt.lisp | evrim_core-server/src/markup/excerpt.lisp | (in-package :core-server)
;; -------------------------------------------------------------------------
;; Excerpt Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass excerpt+ (xml+)
()
(:default-initargs
:namespace "excerpt"
:schema "http://wordpress.org/export/1.0/excerpt/")))
(defclass+ excerpt-element (xml)
((type :host remote :print nil)))
;; +------------------------------------------------------------------------
;; | Excerpt Object Definition: defexceprt-tag
;; +------------------------------------------------------------------------
(defmacro defexcerpt-tag (name &rest attributes)
`(progn
(defclass+ ,name (excerpt-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass excerpt+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
(defexcerpt-tag <excerpt:encoded)
| 1,041 | Common Lisp | .lisp | 25 | 37.76 | 76 | 0.469368 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | ee6ef96ef4b87de670834b3771c877db90b84b875da4a1ab7d9d82b5b667969d | 8,237 | [
-1
] |
8,238 | xml.lisp | evrim_core-server/src/markup/xml.lisp | ;; +------------------------------------------------------------------------
;; | XML Base
;; +------------------------------------------------------------------------
(in-package :core-server)
;; -------------------------------------------------------------------------
;; Protocol
;; -------------------------------------------------------------------------
(defgeneric xml.tag (xml)
(:documentation "Returns tag"))
(defgeneric xml.namespace (xml)
(:documentation "Returns namespace"))
(defgeneric xml.attributes (xml)
(:documentation "Returns symbol names of attributes"))
(defgeneric xml.attribute (xml attribute)
(:documentation "Returns the value of the 'attribute'"))
(defgeneric xml.children (xml)
(:documentation "Returns children of xml node"))
(defgeneric xml.equal (a b)
(:documentation "XML Equivalence Predicate")
(:method ((a t) (b t)) (eq a b))
(:method ((a string) (b string)) (equal a b)))
;; -------------------------------------------------------------------------
;; XML Metaclass
;; -------------------------------------------------------------------------
(defclass xml+ (class+)
((tag :initform nil :initarg :tag :reader xml+.tag)
(namespace :initform nil :initarg :namespace :reader xml+.namespace)
(schema :initform nil :initarg :schema :reader xml+.schema)
(attributes :initarg :attributes :initform nil :reader xml+.attributes)))
(defmethod class+.ctor ((self xml+))
(let ((name (class+.name self)))
`(progn
(fmakunbound ',(class+.ctor-name self))
(defun ,(class+.ctor-name self) (&rest args)
(multiple-value-bind (attributes children) (tag-attributes args)
(apply #'make-instance ',name
(list* :children (flatten children) attributes)))))))
;; -------------------------------------------------------------------------
;; XML Base Class
;; -------------------------------------------------------------------------
(defclass xml ()
((xmlns :initarg :xmlns :accessor xml.xmlns)
(children :initform nil :initarg :children :accessor xml.children)))
(defmethod xml.tag ((xml xml))
(any (lambda (a) (and (typep a 'xml+) (xml+.tag a)))
(class+.superclasses (class-of xml))))
(defmethod xml.attributes ((xml xml))
(any (lambda (a) (and (typep a 'xml+) (xml+.attributes a)))
(class-superclasses (class-of xml))))
(defmethod xml.namespace ((xml xml))
(any (lambda (a) (and (typep a 'xml+) (xml+.namespace a)))
(class-superclasses (class-of xml))))
(defmethod xml.attribute ((xml xml) attribute)
(slot-value xml attribute))
(defmethod xml.equal ((a xml) (b xml))
(and
(string= (xml.tag a) (xml.tag b))
(string= (xml.namespace a) (xml.namespace b))
(reduce (lambda (acc attr)
(and acc (xml.equal (xml.attribute a attr)
(xml.attribute a attr))))
(xml.attributes a)
:initial-value t)
(= (length (xml.children a)) (length (xml.children b)))
(reduce (lambda (acc child)
(and acc (xml.equal (car child) (cdr child))))
(mapcar #'cons (xml.children a) (xml.children b))
:initial-value t)))
(defmethod xml.children ((self t)) nil)
(defun make-xml-type-matcher (type)
(lambda (a) (typep a type)))
(defun xml-search (elements goal-p &optional (successor #'xml.children))
(let ((result))
(core-search (if (listp elements)
elements
(list elements))
(lambda (a)
(if (typep a 'xml)
(if (funcall goal-p a)
(pushnew a result)))
nil)
successor
#'append)
result))
(defun filter-xml-nodes (root goal-p)
(cond
((stringp root) root)
(t
(let ((ctor (core-server::class+.ctor-name (class-of root))))
(apply ctor
(append (reduce0
(lambda (acc attribute)
(aif (xml.attribute root attribute)
(cons (make-keyword attribute)
(cons it acc))
acc))
(xml.attributes root))
(nreverse
(reduce0 (lambda (acc child)
(if (and (not (stringp child))
(funcall goal-p child))
acc
(cons (filter-xml-nodes child goal-p)
acc)))
(xml.children root)))))))))
;; -------------------------------------------------------------------------
;; XML defining macro: defmxl
;; -------------------------------------------------------------------------
(defmacro defxml (name &rest attributes)
`(defclass+ ,name (xml)
(,@(mapcar (lambda (attr) (list attr :print t))
attributes))
(:metaclass xml+)
(:tag ,@(string-downcase (symbol-name name)))
(:namespace ,@(string-downcase
(subseq (package-name (symbol-package name)) 1)))
(:attributes ,@attributes)))
;; -------------------------------------------------------------------------
;; XML Generic Class
;; -------------------------------------------------------------------------
(defclass generic-xml (xml)
((tag :initarg :tag :initform nil :accessor xml.tag)
(namespace :initarg :namespace :initform nil :accessor xml.namespace)
(attributes :initarg :attributes :initform nil)))
(defmethod xml.attributes ((xml generic-xml))
(mapcar #'car (slot-value xml 'attributes)))
(defmethod xml.attribute ((xml generic-xml) attribute)
(cdr (assoc attribute (slot-value xml 'attributes))))
;; -------------------------------------------------------------------------
;; Generic XML Constructor
;; -------------------------------------------------------------------------
(defun xml (tag namespace attributes &rest children)
(make-instance 'generic-xml
:tag tag
:namespace namespace
:attributes attributes
:children (flatten children)))
(defprint-object (self generic-xml)
(with-slots (tag namespace attributes children) self
(if namespace
(format *standard-output* "<~A:~A(~D)~{ ~A~}>"
namespace tag (length children) attributes)
(format *standard-output* "<~A(~D)~{ ~A~}>"
tag (length children) attributes))))
;;---------------------------------------------------------------------------
;; XML Parser
;;---------------------------------------------------------------------------
(defatom xml-attribute-char? ()
(or (alphanum? c) (= c #.(char-code #\-)) (= c #.(char-code #\_))))
(defrule xml-attribute-name? (c attribute namespace)
(:type xml-attribute-char? c)
(:do (setq attribute (make-accumulator)))
(:collect c attribute)
(:zom (:type xml-attribute-char? c) (:collect c attribute))
(:or (:and #\:
(:do (setq namespace attribute)
(setq attribute (make-accumulator)))
(:oom (:type xml-attribute-char? c)
(:collect c attribute))
(:return (if namespace
(values attribute namespace)
attribute)))
(:return (if namespace
(values attribute namespace)
attribute))))
(defrule xml-attribute-value? (c val)
(:or (:and (:quoted? val) (:return val))
(:and (:oom (:not #\Space) (:not #\>) (:not #\/)
(:not #\") (:not #\')
(:do (setq val (make-accumulator :byte)))
(:type octet? c) (:collect c val))
(:return (if val (octets-to-string val :utf-8))))))
(defrule xml-attribute? (name value)
(:xml-attribute-name? name)
#\=
(:xml-attribute-value? value)
(:return (cons name value)))
(defrule xml-tag-name? (tag namespace)
(:xml-attribute-name? tag namespace)
(:return (values tag namespace)))
(defrule xml-lwsp? (c)
(:oom (:or (:and (:type (or space? tab?)))
(:and (:type (or carriage-return? linefeed?))
(:do (setf c t))))
(:if c
(:return #\Newline)
(:return #\Space))))
(defrule xml-text-node? (c acc)
(:not #\/)
;; (:not #\<)
;; (:checkpoint #\< (:rewind-return (octets-to-string acc :utf-8)))
(:or ;; (:and #\& (:or (:and (:seq "gt;") (:do (setf c #\<)))
;; (:and (:seq "lt;") (:do (setf c #\>)))))
(:and (:seq ">") (:do (setf c #\<)))
(:and (:seq "<") (:do (setf c #\>)))
(:and (:seq """) (:do (setf c #\")))
(:xml-lwsp? c)
(:type octet? c))
(:do (setq acc (make-accumulator :byte)))
(:collect c acc)
(:zom (:not #\<)
;; (:checkpoint #\< (:rewind-return (octets-to-string acc :utf-8)))
(:or (:and (:seq ">") (:do (setf c #\<)))
(:and (:seq "<") (:do (setf c #\>)))
(:and (:seq """) (:do (setf c #\")))
;; (:and #\& (:or (:and (:seq "gt;") (:do (setf c #\<)))
;; (:and (:seq "lt;") (:do (setf c #\>)))))
(:xml-lwsp? c)
(:type octet? c))
(:collect c acc))
(:if (> (length acc) 0)
(:return (octets-to-string acc :utf-8))))
(defrule xml-cdata? (c acc)
(:seq "CDATA[")
(:do (setq acc (make-accumulator :byte)))
(:zom (:not (:seq "]]>")) (:type octet? c) (:collect c acc))
(:return (octets-to-string acc :utf-8)))
(defrule xml-comment? (c acc)
;; #\<
;; #\!
#\- #\- ;; (:seq "<!--")
(:do (setq acc (make-accumulator)))
(:collect #\< acc) (:collect #\! acc)
(:collect #\- acc) (:collect #\- acc)
(:zom (:not (:seq "-->"))
(:type octet? c)
(:collect c acc))
(:collect #\- acc)
(:collect #\- acc)
(:collect #\> acc)
(:return acc))
(defparser %xml-lexer? (tag namespace attr attrs child children
a b c d)
(:xml-tag-name? tag namespace)
(:zom (:lwsp?) (:xml-attribute? attr)
(:do (push attr attrs)))
(:or
(:and (:lwsp?) (:seq "/>")
(:return (values tag namespace (nreverse attrs))))
(:and #\>
(:checkpoint
(:zom (:lwsp?)
;; (:debug)
(:or
(:and #\<
(:or (:and #\!
(:or (:xml-cdata? child)
(:xml-comment? child))
(:do (push child children)))
(:and (:%xml-lexer? a b c d)
(:do (push (list* a b c d) children)))))
(:and (:%xml-lexer? a b c d)
(:do (push (list* a b c d) children)))
(:and (:xml-text-node? child)
(:do (push child children))
;; #\/
;; (:if namespace
;; (:and (:sci namespace) #\: (:sci tag))
;; (:sci tag))
;; #\>
;; (:return (values tag namespace (nreverse attrs)
;; (nreverse children)))
)
))
(:or (:and #\/
(:if namespace
(:and (:sci namespace) #\: (:sci tag))
(:sci tag))
#\>
(:return (values tag namespace (nreverse attrs)
(nreverse children))))
(:rewind-return (values tag namespace (nreverse attrs))))))))
(defparser xml-lexer? (tag namespace attrs children child)
(:lwsp?)
(:checkpoint (:seq "<?xml")
(:zom (:not #\>) (:type octet?)) (:lwsp?) (:commit))
(:checkpoint (:seq "<!DOCTYPE")
(:zom (:not #\>) (:type octet?)) (:lwsp?) (:commit))
#\<
(:optional #\! (:or (:xml-cdata? child) (:xml-comment? child))
(:lwsp?) #\<)
(:%xml-lexer? tag namespace attrs children)
(:return (list* tag namespace attrs children)))
(defvar +xml-namespace+ (find-package :<))
(defparameter +xml-namespaces-table+
(list (cons "http://labs.core.gen.tr/2011/DB" (find-package :<db))
(cons "http://labs.core.gen.tr/2011/API" (find-package :<core-server))
(cons "http://www.w3.org/2001/XMLSchema" (find-package :<xs))
(cons "http://www.w3.org/2005/Atom" (find-package :<atom))
(cons "http://schemas.google.com/photos/2007" (find-package :<gphoto))
(cons "http://search.yahoo.com/mrss/" (find-package :<media))
(cons "http://www.opensearch.org/Specifications/OpenSearch/1.1"
(find-package :<open-search))
(cons "http://wordpress.org/export/1.0/" (find-package :<wordpress))
(cons "http://purl.org/rss/1.0/modules/content/" (find-package :<content))
(cons "http://purl.org/dc/elements/1.1/" (find-package :<dc))
(cons "http://wordpress.org/export/1.0/excerpt/" (find-package :<excerpt))))
(defun register-xml-namespace (namespace package)
(let ((package (find-package package)))
(assert (not (null package)))
(setf +xml-namespaces-table+
(cons (cons namespace package)
(remove namespace +xml-namespaces-table+ :key #'car :test #'equal)))))
(declaim (inline xml->symbol))
(defun xml->symbol (name &optional package)
(let ((a (reduce (lambda (acc a)
(cond
((and (> (char-code a) 64)
(< (char-code a) 91))
(push-atom #\- acc)
(push-atom (code-char (+ (char-code a)
32))
acc))
(t (push-atom a acc)))
acc)
name :initial-value (make-accumulator))))
(if package
(intern (string-upcase a) package)
(intern (string-upcase a) (find-package :<)))))
(defun parse-xml (xml &optional default-namespace)
(labels ((make-generic-element (tag namespace attributes children)
(warn "<~A:~A> tag not found, using generic xml element."
namespace tag)
(apply #'xml tag namespace
(cons attributes (mapcar #'parse-xml children))))
(make-element (symbol attributes children)
(apply symbol
(append
(reduce0 (lambda (acc attr)
(cons (js->keyword (car attr))
(cons (cdr attr) acc)))
attributes)
(mapcar #'parse-xml children)))))
(if (atom xml)
xml
(destructuring-bind (tag namespace attributes &rest children) xml
(let* ((+xml-namespace+
(acond
((and namespace (find-package
(make-keyword
(format nil "<~A"
(symbol-name
(xml->symbol namespace))))))
it)
((cdr (assoc (cdr
(assoc "xmlns" attributes :test #'string=))
+xml-namespaces-table+ :test #'string=))
it)
((and default-namespace
(find-package
(make-keyword
(format nil "<~A"
(symbol-name
(xml->symbol default-namespace))))))
it)
(t +xml-namespace+)))
(symbol (let ((symbol1 (xml->symbol tag +xml-namespace+))
(symbol2 (intern tag +xml-namespace+)))
(if (fboundp symbol1)
symbol1
(if (fboundp symbol2)
symbol2)))))
(if (and symbol
(not (eq (symbol-package symbol) #.(find-package :cl)))
;; (not (eq (symbol-package symbol) #.(find-package :arnesi)))
)
(let ((instance (make-element symbol attributes children)))
(if (slot-exists-p instance 'tag)
(setf (slot-value instance 'tag) tag))
(if (slot-exists-p instance 'namespace)
(setf (slot-value instance 'namespace) namespace))
instance)
(make-generic-element tag namespace attributes children)))))))
;; +------------------------------------------------------------------------
;; | XML Stream
;; +------------------------------------------------------------------------
(defclass xml-stream (wrapping-stream)
((namespace :initform nil :initarg :namespace :reader namespace)))
(defun make-xml-stream (stream &optional namespace)
(make-instance 'xml-stream :stream stream
:namespace namespace))
(defmethod read-stream ((stream xml-stream))
(parse-xml (xml-lexer? (slot-value stream '%stream))
(namespace stream)))
(defmethod write-stream ((stream xml-stream) (list list))
(reduce #'write-stream list :initial-value stream))
(defmethod write-stream ((stream xml-stream) (string string))
(prog1 stream
(with-slots (%stream) stream
(disable-indentation %stream)
(string! %stream
(reduce (lambda (acc atom)
(cond
((eq atom #\<)
(push-atom #\& acc)
(push-atom #\g acc)
(push-atom #\t acc)
(push-atom #\; acc))
((eq atom #\>)
(push-atom #\& acc)
(push-atom #\l acc)
(push-atom #\t acc)
(push-atom #\; acc))
(t
(push-atom atom acc)))
acc)
string
:initial-value (make-accumulator)))
(enable-indentation %stream))))
(defmethod intro! ((stream xml-stream) (object xml))
(with-slots (%stream) stream
(let ((tag (xml.tag object))
(namespace (xml.namespace object)))
(char! %stream #\<)
(if (and namespace (not (equal namespace (namespace stream))))
(progn
(string! %stream namespace)
(char! %stream #\:)
(string! %stream tag))
(string! %stream tag)))
stream))
(defmethod attribute! ((stream xml-stream) attribute)
(with-slots (%stream) stream
(char! %stream #\Space)
(if (symbolp (car attribute))
(string! %stream (symbol-to-js (car attribute)))
(string! %stream (car attribute)))
(char! %stream #\=)
(quoted! %stream (format nil "~A" (cdr attribute)))
stream))
(defmethod child! ((stream xml-stream) object)
(char! (slot-value stream '%stream) #\Newline)
(write-stream stream object)
stream)
(defmethod outro! ((stream xml-stream) (object xml))
(with-slots (%stream) stream
(let ((tag (xml.tag object))
(namespace (xml.namespace object)))
(string! %stream "</")
(if (and namespace (not (equal (namespace stream) namespace)))
(progn
(string! %stream namespace)
(char! %stream #\:)
(string! %stream tag))
(string! %stream tag))
(char! %stream #\>))
stream))
(defmethod write-stream ((stream xml-stream) (object xml))
(with-slots (%stream) stream
(intro! stream object)
(reduce #'attribute!
(reduce0 (lambda (acc slot)
(aif (slot-value object slot)
(cons (cons slot it) acc)
acc))
(xml.attributes object))
:initial-value stream)
(cond
((null (xml.children object))
(string! %stream "/>"))
((eq 1 (length (xml.children object)))
(stringp (car (xml.children object)))
(char! %stream #\>)
(write-stream stream (car (xml.children object)))
(outro! stream object))
(t
(char! %stream #\>)
(increase-indent %stream)
(reduce #'child!
(slot-value object 'children)
:initial-value stream)
(decrease-indent %stream)
(char! %stream #\Newline)
(outro! stream object)))
stream))
(defmethod write-stream ((stream xml-stream) (object generic-xml))
(with-slots (%stream) stream
(intro! stream object)
(reduce #'attribute!
(slot-value object 'attributes)
:initial-value stream)
(cond
((null (xml.children object))
(string! %stream "/>"))
((stringp (car (xml.children object)))
(char! %stream #\>)
(write-stream stream (car (xml.children object)))
(outro! stream object))
(t
(char! %stream #\>)
(increase-indent %stream)
(reduce #'child!
(slot-value object 'children)
:initial-value stream)
(decrease-indent %stream)
(char! %stream #\Newline)
(outro! stream object)))
stream))
(deftrace xml-render
'(intro! outro! child! write-stream attribute!))
;;---------------------------------------------------------------------------
;; Relaxed XML Parser
;;---------------------------------------------------------------------------
;; This is a duplicate of the xml parser that is slow but allows
;; us to parse some of the broken xml's like HTML.
;;http://msdn.microsoft.com/en-us/library/ms537495.aspx
(eval-when (:load-toplevel :compile-toplevel :execute)
(defparameter +xml-entities+
'(("gt" . #\<)
("lt" . #\>)
("quot" . #\")
("nbsp" . #\Space)
("amp" . #\&)
("Uuml" . #\Ü)
("Ouml" . #\Ö)
("Ccedil" . #\Ç)
("uuml" . #\ü)
("ouml" . #\ö)
("ccedil" . #\ç))))
(defmacro defxml-entity-parser (entities)
`(defparser xml-entity? ()
(:or ,@(mapcar (lambda (e)
`(:and (:seq ,(format nil "~A;" (car e)))
(:return ,(cdr e))))
(symbol-value entities)))))
(defxml-entity-parser +xml-entities+)
(defrule relaxed-xml-text-node? (c (acc (make-accumulator :byte)))
(:debug)
(:not #\<)
;; (:checkpoint #\< (:rewind-return (octets-to-string acc :utf-8)))
(:oom (:checkpoint #\< (:rewind-return (octets-to-string acc :utf-8)))
(:or (:and #\& (:xml-entity? c)
(:do (reduce (lambda (acc a)
(push-atom a acc)
acc)
(string-to-octets (format nil "~A" c) :utf-8)
:initial-value acc)))
(:and (:or (:xml-lwsp? c)
(:type octet? c)) (:collect c acc))))
(:if (> (length acc) 0)
(:return (octets-to-string acc :utf-8))))
(defrule relaxed-xml-comment? (c acc)
(:seq "<!--")
(:do (setq acc (make-accumulator :byte)))
(:collect #\< acc) (:collect #\! acc)
(:collect #\- acc) (:collect #\- acc)
(:zom (:not (:seq "-->")) (:type octet? c) (:collect c acc))
(:collect #\- acc) (:collect #\- acc) (:collect #\> acc)
(:return (octets-to-string acc :utf-8)))
(defparser %relaxed-xml-lexer? (tag namespace attr attrs child children
immediate)
#\<
(:xml-tag-name? tag namespace)
(:do (describe (list tag namespace)))
(:debug)
(:zom (:lwsp?) (:xml-attribute? attr)
(:do (push attr attrs)))
(:or (:and (:lwsp?)
(:seq "/>")
(:return (list tag namespace (nreverse attrs))))
(:and #\>
(:zom (:lwsp?)
(:or
(:debug)
(:checkpoint
(:seq "</")
(:if namespace
(:not (:and (:sci namespace) #\: (:sci tag)))
(:not (:sci tag)))
(:debug)
(:do (describe (list 'foo tag namespace children) ))
(:rewind-return nil ;; (values
;; (list* tag namespace (nreverse attrs)
;; (nreverse children))
;; t)
))
(:oom (:%relaxed-xml-lexer? child)
(:do (push child children)))
(:relaxed-xml-comment? child)
(:xml-text-node? child)
(:xml-cdata? child))
(:do (push child children)))
(:or (:and (:seq "</")
(:if namespace
(:and (:sci namespace) #\: (:sci tag))
(:sci tag))
#\>
(:return (list* tag namespace (nreverse attrs)
(nreverse children))))
(:return (list* tag namespace (nreverse attrs)
(nreverse children)))))))
(defparser relaxed-xml-lexer? (tag namespace attr attrs child children)
(:lwsp?)
(:checkpoint (:seq "<?xml")
(:zom (:not #\>) (:type octet?)) (:lwsp?) (:commit))
(:checkpoint (:sci "<!DOCTYPE")
(:zom (:not #\>) (:type octet?)) (:lwsp?) (:commit))
(:zom (:lwsp?) (:relaxed-xml-comment? child) (:lwsp?))
(:%relaxed-xml-lexer? tag)
(:return tag))
;; +------------------------------------------------------------------------
;; | Relaxed XML Stream
;; +------------------------------------------------------------------------
(defclass relaxed-xml-stream (xml-stream)
())
(defun make-relaxed-xml-stream (stream &optional namespace)
(make-instance 'relaxed-xml-stream :stream stream
:namespace namespace))
(defmethod read-stream ((stream relaxed-xml-stream))
(parse-xml (xml-lexer? (slot-value stream '%stream))
(namespace stream)))
(defmethod write-stream ((stream relaxed-xml-stream) (object xml))
(with-slots (%stream) stream
(intro! stream object)
(reduce #'attribute!
(reduce0 (lambda (acc slot)
(aif (slot-value object slot)
(cons (cons slot it) acc)
acc))
(xml.attributes object))
:initial-value stream)
(cond
;; ((null (xml.children object))
;; (string! %stream "/>"))
((eq 1 (length (xml.children object)))
(stringp (car (xml.children object)))
(char! %stream #\>)
(write-stream stream (car (xml.children object)))
(outro! stream object))
(t
(char! %stream #\>)
(increase-indent %stream)
(reduce #'child!
(slot-value object 'children)
:initial-value stream)
(decrease-indent %stream)
(char! %stream #\Newline)
(outro! stream object)))
stream))
(defmethod write-stream ((stream relaxed-xml-stream) (object generic-xml))
(with-slots (%stream) stream
(intro! stream object)
(reduce #'attribute!
(slot-value object 'attributes)
:initial-value stream)
(cond
;; ((null (xml.children object))
;; (string! %stream "/>"))
((stringp (car (xml.children object)))
(char! %stream #\>)
(write-stream stream (car (xml.children object)))
(outro! stream object))
(t
(char! %stream #\>)
(increase-indent %stream)
(reduce #'child!
(slot-value object 'children)
:initial-value stream)
(decrease-indent %stream)
(char! %stream #\Newline)
(outro! stream object)))
stream))
;; -------------------------------------------------------------------------
;; Trace Definition
;; -------------------------------------------------------------------------
(deftrace xml-parsers
'(xml-tag-name? xml-lexer? xml-comment? xml-text-node?
xml-cdata? %xml-lexer? xml-lwsp? xml-attribute?
xml-attribute-name? xml-attribute-value?
xml-tag-name? relaxed-xml-lexer? relaxed-xml-comment?
relaxed-xml-text-node? xml-cdata? xml-lwsp?
xml-attribute? xml-attribute-name?
xml-attribute-value? parse-xml))
| 24,464 | Common Lisp | .lisp | 673 | 31.197623 | 77 | 0.554993 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | ef36b35c5910ae1ad5fd83e153272ff1530e7206dc98ae00801c45f2db9d9f0d | 8,238 | [
-1
] |
8,239 | atom.lisp | evrim_core-server/src/markup/atom.lisp | ;; +-------------------------------------------------------------------------
;; | RFC 4287 - The Atom Syndication Format
;; +-------------------------------------------------------------------------
;;
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2011
;;
;; Specification: http://tools.ietf.org/html/rfc4287
;;
(in-package :core-server)
(defxml-namespace atom (make-xml-schema-pathname "atom.xsd") t)
;; RSS 2.0 Compatbility
(defatom-tag <atom:rss gphoto media opensearch exif geo gml georss batch gd)
(defatom-tag <atom:channel)
(defatom-tag <atom:description)
(defatom-tag <atom:pub-date)
(defatom-tag <atom:language)
(defatom-tag <atom:cloud)
(defatom-tag <atom:image)
(defatom-tag <atom:url)
(defatom-tag <atom:item)
(defatom-tag <atom:guid)
;; ;; -------------------------------------------------------------------------
;; ;; Atom Metaclass
;; ;; -------------------------------------------------------------------------
;; (eval-when (:compile-toplevel :load-toplevel :execute)
;; (defclass atom+ (xml+)
;; ()
;; (:default-initargs
;; :namespace "atom"
;; :schema "http://www.w3.org/2005/Atom")))
;; (defclass+ atom-element (xml)
;; ((type :host remote :print nil)))
;; ;; +------------------------------------------------------------------------
;; ;; | Atom Object Definition: defatom-tag
;; ;; +------------------------------------------------------------------------
;; (defmacro defatom-tag (name &rest attributes)
;; `(progn
;; (defclass+ ,name (atom-element)
;; (,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
;; attributes))
;; (:metaclass atom+)
;; (:tag ,@(string-downcase (symbol-name name)))
;; (:attributes ,@attributes))
;; (find-class+ ',name)))
;; (defatom-tag <atom:feed gphoto media opensearch exif geo gml georss batch gd)
;; (defatom-tag <atom:content src)
;; (defatom-tag <atom:author)
;; (defatom-tag <atom:category term scheme label)
;; (defatom-tag <atom:contributor)
;; (defatom-tag <atom:generator version uri)
;; (defatom-tag <atom:icon)
;; (defatom-tag <atom:id)
;; (defatom-tag <atom:link rel href hreflang title length)
;; (defatom-tag <atom:logo)
;; (defatom-tag <atom:rights)
;; (defatom-tag <atom:subtitle)
;; (defatom-tag <atom:title)
;; (defatom-tag <atom:updated)
;; (defatom-tag <atom:name)
;; (defatom-tag <atom:uri)
;; (defatom-tag <atom:email)
;; (defatom-tag <atom:entry)
;; (defatom-tag <atom:published)
;; (defatom-tag <atom:summary)
;; ;; RSS 2.0 Compatbility
;; (defatom-tag <atom:rss gphoto media opensearch exif geo gml georss batch gd)
;; (defatom-tag <atom:channel)
;; (defatom-tag <atom:description)
;; (defatom-tag <atom:pub-date)
;; (defatom-tag <atom:language)
;; (defatom-tag <atom:cloud)
;; (defatom-tag <atom:image)
;; (defatom-tag <atom:url)
;; (defatom-tag <atom:item)
;; (defatom-tag <atom:guid)
;; (defparameter +atom-feed+
;; "<?xml version= \"1.0\" encoding= \"utf-8\"?>
;; <feed xmlns=\"http://www.w3.org/2005/Atom\">
;; <title>Example Feed</title>
;; <subtitle>A subtitle.</subtitle>
;; <link href=\"http://example.org/feed/\" rel=\"self\" />
;; <link href=\"http://example.org/\" />
;; <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
;; <updated>2003-12-13T18:30:02Z</updated>
;; <author>
;; <name>John Doe</name>
;; <email>[email protected]</email>
;; </author>
;; <entry>
;; <title>Atom-Powered Robots Run Amok</title>
;; <link href=\"http://example.org/2003/12/13/atom03\" />
;; <link rel=\"alternate\" type=\"text/html\"
;; href=\"http://example.org/2003/12/13/atom03.html\"/>
;; <link rel=\"edit\"
;; href=\"http://example.org/2003/12/13/atom03/edit\"/>
;; <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
;; <updated>2003-12-13T18:30:02Z</updated>
;; <summary>Some text.</summary>
;; </entry>
;; </feed>")
;; SERVER> (parse-xml (xml-lexer? (make-core-stream +atom-feed+)))
;; #<TR.GEN.CORE.SERVER.ATOM:FEED {10038A63C1}>
;; or
;; SERVER> (read-stream (make-xml-stream (make-core-stream +atom-feed+)))
;; #<TR.GEN.CORE.SERVER.ATOM:FEED {10038A63C1}>
| 4,321 | Common Lisp | .lisp | 106 | 39.632075 | 80 | 0.555556 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 9ef212aff434b6c484308fa1f65605c3cf2c312e06bcc6488b73797219b50ae8 | 8,239 | [
-1
] |
8,240 | dc.lisp | evrim_core-server/src/markup/dc.lisp | (in-package :core-server)
;; -------------------------------------------------------------------------
;; DC Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass dc+ (xml+)
()
(:default-initargs
:namespace "dc"
:schema "http://purl.org/dc/elements/1.1/")))
(defclass+ dc-element (xml)
((type :host remote :print nil)))
;; +------------------------------------------------------------------------
;; | Atom Object Definition: defatom-tag
;; +------------------------------------------------------------------------
(defmacro defdc-tag (name &rest attributes)
`(progn
(defclass+ ,name (dc-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass dc+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
(defdc-tag <dc:creator)
| 982 | Common Lisp | .lisp | 25 | 35.4 | 76 | 0.436516 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | a7d5e324de2379952d9e05c91628e63337a1a87a44502896130f8f7ad9b23a6e | 8,240 | [
-1
] |
8,241 | extra.lisp | evrim_core-server/src/markup/extra.lisp | ;; Core Server: Web Application Server
;; Copyright (C) 2006-2008 Metin Evrim Ulu, Aycan iRiCAN
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :core-server)
;; (defclass dojo-element (dom-element)
;; ())
;; (defmacro defdojo (name &rest attributes)
;; (let ((attributes (make-attributes attributes))
;; (symbol-package (symbol-package name)))
;; `(prog1 (defclass ,name (dojo-element)
;; ())
;; (defun ,name (&rest args)
;; (multiple-value-bind (attributes children) (tag-attributes args)
;; (destructuring-bind (&key ,@attributes) attributes
;; (validate-dom-tree
;; (apply #'make-dom-element ,(symbol-name name)
;; (remove-if (lambda (attr)
;; (if (null (cdr attr))
;; t))
;; (list ,@(mapcar (lambda (attr)
;; `(cons ,(symbol-to-js attr) ,attr))
;; attributes)))
;; children)))))
;; (export ',name (find-package ,(package-name symbol-package))))))
;; (defdojo <dijit::dialog open duration title)
| 1,617 | Common Lisp | .lisp | 34 | 46.088235 | 74 | 0.675349 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | fb15679469bedb2b3aff3422f9680670464aeb475aa7a3bbf14c03c8215c0559 | 8,241 | [
-1
] |
8,242 | gphoto.lisp | evrim_core-server/src/markup/gphoto.lisp | ;; +-------------------------------------------------------------------------
;; | Google GPhoto Markup
;; +-------------------------------------------------------------------------
;;
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2011
;;
;; Specification:
;; http://code.google.com/apis/picasaweb/docs/2.0/reference.html#gphoto_reference
(in-package :core-server)
;; -------------------------------------------------------------------------
;; Atom Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass gphoto+ (xml+)
()
(:default-initargs
:namespace "gphoto"
:schema "http://schemas.google.com/photos/2007")))
(defclass+ gphoto-element (xml)
())
;; +------------------------------------------------------------------------
;; | Atom Object Definition: defatom-tag
;; +------------------------------------------------------------------------
(defmacro defgphoto-tag (name &rest attributes)
`(progn
(defclass+ ,name (gphoto-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass gphoto+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
;; https://picasaweb.google.com/data/feed/api/user/evrimulu?alt=json
(defgphoto-tag <gphoto:albumid)
(defgphoto-tag <gphoto:id)
(defgphoto-tag <gphoto:max-photos-per-album)
(defgphoto-tag <gphoto:nickname)
(defgphoto-tag <gphoto:quotacurrent)
(defgphoto-tag <gphoto:quotalimit)
(defgphoto-tag <gphoto:thumbnail)
(defgphoto-tag <gphoto:user)
(defgphoto-tag <gphoto:name)
(defgphoto-tag <gphoto:access)
(defgphoto-tag <gphoto:bytes-used)
(defgphoto-tag <gphoto:location)
(defgphoto-tag <gphoto:numphotos)
(defgphoto-tag <gphoto:numphotosremaining)
(defgphoto-tag <gphoto:checksum)
(defgphoto-tag <gphoto:comment-count)
(defgphoto-tag <gphoto:commenting-enabled)
(defgphoto-tag <gphoto:height)
(defgphoto-tag <gphoto:rotation)
(defgphoto-tag <gphoto:size)
(defgphoto-tag <gphoto:timestamp)
(defgphoto-tag <gphoto:videostatus)
(defgphoto-tag <gphoto:width)
(defgphoto-tag <gphoto:albumtitle)
(defgphoto-tag <gphoto:albumdesc)
(defgphoto-tag <gphoto:album-type)
(defgphoto-tag <gphoto:snippet)
(defgphoto-tag <gphoto:snippettype)
(defgphoto-tag <gphoto:truncated)
(defgphoto-tag <gphoto:photoid)
(defgphoto-tag <gphoto:weight)
(defgphoto-tag <gphoto:allow-prints)
(defgphoto-tag <gphoto:allow-downloads)
(defgphoto-tag <gphoto:version)
(defgphoto-tag <gphoto:client)
(defgphoto-tag <gphoto:license id name url)
(defgphoto-tag <gphoto:image-version)
;; (defgphoto-tag <gphoto:position) ;; FIXME -evrim. | 2,703 | Common Lisp | .lisp | 72 | 35.555556 | 81 | 0.622907 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | de1a7fd41b27c969b5280b0909004f5b4ea1226ecd039ac265641d961624630b | 8,242 | [
-1
] |
8,243 | wordpress.lisp | evrim_core-server/src/markup/wordpress.lisp | ;; +-------------------------------------------------------------------------
;; | Wordpress
;; +-------------------------------------------------------------------------
;;
;; Author: Evrim Ulu <[email protected]>
;; Date: October 2011
;;
;; Namespace: http://wordpress.org/export/1.0/
;;
(in-package :core-server)
;; -------------------------------------------------------------------------
;; WordPress Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass wordpress+ (xml+)
()
(:default-initargs
:namespace "wp"
:schema "http://wordpress.org/export/1.0/")))
(defclass+ wordpress-element (xml)
((type :host remote :print nil)))
;; +------------------------------------------------------------------------
;; | WordPress Object Definition: defwp-tag
;; +------------------------------------------------------------------------
(defmacro defwp-tag (name &rest attributes)
`(progn
(defclass+ ,name (atom-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass wordpress+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
(defwp-tag <wp:wxr_version)
(defwp-tag <wp:base_site_url)
(defwp-tag <wp:base_blog_url)
(defwp-tag <wp:author)
(defwp-tag <wp:author_id)
(defwp-tag <wp:author_email)
(defwp-tag <wp:author_login)
(defwp-tag <wp:author_display_name)
(defwp-tag <wp:author_first_name)
(defwp-tag <wp:author_last_name)
(defwp-tag <wp:category)
(defwp-tag <wp:category_nicename)
(defwp-tag <wp:category_parent)
(defwp-tag <wp:category_description)
(defwp-tag <wp:cat_name)
(defwp-tag <wp:tag)
(defwp-tag <wp:tag_slug)
(defwp-tag <wp:tag_name)
(defwp-tag <wp:term)
(defwp-tag <wp:term_id)
(defwp-tag <wp:term_taxonomy)
(defwp-tag <wp:term_slug)
(defwp-tag <wp:term_name)
(defwp-tag <wp:term_parent)
(defwp-tag <wp:post_id)
(defwp-tag <wp:post_name)
(defwp-tag <wp:post_parent)
(defwp-tag <wp:post_date)
(defwp-tag <wp:post_date_gmt)
(defwp-tag <wp:post_type)
(defwp-tag <wp:post_password)
(defwp-tag <wp:comment_status)
(defwp-tag <wp:ping_status)
(defwp-tag <wp:status)
(defwp-tag <wp:menu_order)
(defwp-tag <wp:is_sticky)
(defwp-tag <wp:postmeta)
(defwp-tag <wp:meta_key)
(defwp-tag <wp:meta_value)
(defwp-tag <wp:comment)
(defwp-tag <wp:comment_id)
(defwp-tag <wp:comment_author)
(defwp-tag <wp:comment_author_email)
(defwp-tag <wp:comment_author_url)
(defwp-tag <wp:comment_author_-I-P)
(defwp-tag <wp:comment_user_id)
(defwp-tag <wp:comment_date)
(defwp-tag <wp:comment_date_gmt)
(defwp-tag <wp:comment_content)
(defwp-tag <wp:comment_approved)
(defwp-tag <wp:comment_type)
(defwp-tag <wp:comment_parent)
(defwp-tag <wp:attachment_url) | 2,798 | Common Lisp | .lisp | 86 | 30.709302 | 77 | 0.592839 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | d5fdb3993448a6e35e5eb5e0eb4148c745b71015a503dd6732b874176141d865 | 8,243 | [
-1
] |
8,244 | content.lisp | evrim_core-server/src/markup/content.lisp | (in-package :core-server)
;; -------------------------------------------------------------------------
;; Content Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass content+ (xml+)
()
(:default-initargs
:namespace "content"
:schema "http://purl.org/rss/1.0/modules/content/")))
(defclass+ content-element (xml)
((type :host remote :print nil)))
;; +------------------------------------------------------------------------
;; | Content Object Definition: defcontent-tag
;; +------------------------------------------------------------------------
(defmacro defcontent-tag (name &rest attributes)
`(progn
(defclass+ ,name (content-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
attributes))
(:metaclass content+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
(defcontent-tag <content:encoded)
| 1,041 | Common Lisp | .lisp | 25 | 37.76 | 76 | 0.468379 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 736a929430afec1edbfadd01935ed28700a5b9f08364219f44cc09d8a89fccd7 | 8,244 | [
-1
] |
8,245 | geoml.lisp | evrim_core-server/src/markup/geoml.lisp | ;; +-------------------------------------------------------------------------
;; | GeoRSS & GeoMarkupLanguage
;; +-------------------------------------------------------------------------
;;
;; Author: Evrim Ulu <[email protected]>
;; Date: July 2011
;;
;; Specification: http://tools.ietf.org/html/rfc4287
;;
(in-package :core-server)
;; -------------------------------------------------------------------------
;; GeoML Metaclass
;; -------------------------------------------------------------------------
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass geo-ml+ (xml+)
()
(:default-initargs
:namespace "atom"
:schema "http://www.w3.org/2005/Atom")))
(defclass+ atom-element (xml)
((type :host remote :print nil)))
;; +------------------------------------------------------------------------
;; | Atom Object Definition: defatom-tag
;; +------------------------------------------------------------------------
(defmacro defatom-tag (name &rest attributes)
`(progn
(defclass+ ,name (atom-element)
(,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
(remove 'id attributes)))
(:metaclass atom+)
(:tag ,@(string-downcase (symbol-name name)))
(:attributes ,@attributes))
(find-class+ ',name)))
| 1,292 | Common Lisp | .lisp | 33 | 36 | 77 | 0.416401 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 6f342ebefd4a3824e73830a91eee0a32415e24a6498bd3668f4afdc59b66d336 | 8,245 | [
-1
] |
8,246 | core-server.lisp | evrim_core-server/src/markup/core-server.lisp | (in-package :core-server)
;; Moved to src/manager/api.lisp, evrim.
;; ;; -------------------------------------------------------------------------
;; ;; Data Definitions
;; ;; -------------------------------------------------------------------------
;; ;; +xml-namespaces-table+
;; (eval-when (:compile-toplevel :load-toplevel :execute)
;; (defclass <core-server:markup+ (xml+)
;; ()
;; (:default-initargs
;; :namespace "coreServer"
;; :schema "http://labs.core.gen.tr/2012/API/")))
;; (defclass+ <core-server:markup (xml)
;; ()
;; (:metaclass <core-server:markup+))
;; ;; +------------------------------------------------------------------------
;; ;; | Core-Server Markup Definition: defcore-server-tag
;; ;; +------------------------------------------------------------------------
;; (defmacro defcore-server-tag (name &rest attributes)
;; `(progn
;; (defclass+ ,name (<core-server:markup)
;; (,@(mapcar (lambda (attr) (list attr :print nil :host 'remote))
;; attributes))
;; (:metaclass <core-server:markup+)
;; (:tag ,@(string-downcase (symbol-name name)))
;; (:attributes ,@attributes))
;; (find-class+ ',name)))
;; (defcore-server-tag <core-server:response)
;; (defcore-server-tag <core-server:authentication status)
;; (defcore-server-tag <core-server:user email name)
| 1,355 | Common Lisp | .lisp | 30 | 43.9 | 79 | 0.487491 | evrim/core-server | 16 | 3 | 1 | GPL-3.0 | 9/19/2024, 11:26:41 AM (Europe/Amsterdam) | 27b2d090ff708d5d5fa29791bf6f4483bdd918a50b3e0faf291514978f2de4d4 | 8,246 | [
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.