Re: [sage-devel] Representation of LinearLayers in the crypto module

2018-07-06 Thread Friedrich Wiemer
Well, this seems to be due to another part of the file, I got a MWE to work, so I guess I will figure it out. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [sage-devel] Representation of LinearLayers in the crypto module

2018-07-06 Thread Friedrich Wiemer
Ah, this looks good! Interestingly, while this works in the sage notebook, changing it in the module results in an sage: from sage.crypto.linearlayer import LinearLayerFactory sage: LinearLayerFactory(GF(2))(MatrixSpace(GF(2), 2, 2), [1,0,0,1])

Re: [sage-devel] Representation of LinearLayers in the crypto module

2018-07-06 Thread 'Martin R. Albrecht' via sage-devel
Hi Friedrich, I was thinking maybe something like this: from sage.matrix.matrix_mod2_dense import Matrix_mod2_dense, from sage.matrix.matrix_gf2e_dense import Matrix_gf2e_dense class LinearLayer: def foo(self): return self[0, 1] def LinearLayerFactory(K): if K.characteristic()

[sage-devel] Representation of LinearLayers in the crypto module

2018-07-06 Thread Friedrich Wiemer
Hi, I worked on an implementation of linear layers (basically a matrix over GF(2) or GF(2^n) with some special methods) in the crypto module during the sage days 94 and came up with this: #25735. Martin commented that it might make sense to just inherit from an appropriate matrix class, to